Linux How to Zip

Linux How to Zip

To create a compressed file and save disk space use following the following syntax:

zip options file1 file2 file3 folder

The zip program compresses one or more files into the archive. Zip has options from “1” to “9”. Option -1 use for fast compression and -9 for better compress ratios.

zip -9 file1 file2

If you want to insert a new file to the existing zip archive use options “u” which means update.

zip -u newFile

To decompress the zip archive use command:


To decompress to a specific directory use the “d” option:

unzip -d /directory

Command tar is a great tool too. You can compress files with tar:

tar -zcvf name.tgz file1 file2 file3 folder

To unzip compressed file type:

tar -zxvf name.tgz

Leave a Comment