Unix Zip/Unzip Command

UNIX/Linux provides zip/unzip commands to compress/decompress files.

  • zip – Package and compress (archive) files.
  • unzip – Extract and list compressed files in a ZIP archive.

Create a Zip File

Create a zip file from a list of files.

zip zname.zip fname.txt fname2.txt pic.jpg

Compress all files in a directory into a zip archive.

zip -r data.zip /data

Decompress a Zip File

Extract all contents from a zip file.

unzip zname.zip
unzip data.zip

Comments

comments