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 compress one or more files into the archive. Zip has an options from "1" to "9". The option -1 use for a 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 "d" option:

unzip -d /directory

Command tar is 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

Was this information helpful to you? You have the power to keep it alive.
Each donated € will be spent on running and expanding this page about UNIX Shell.