To create a compressed file and save disk space use following the following syntax:
zip options name.zip file1 file2 file3 folder
The zip program compress one or more files into the name.zip 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 name.zip file1 file2
If you want to insert a new file to the existing zip archive use options "u" which means update.
zip -u name.zip newFile
To decompress the zip archive use command:
unzip name.zip
To decompress to a specific directory use "d" option:
unzip name.zip -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.
We prepared for you video course Marian's BASH Video Training: Mastering Unix Shell, if you would like to get much more information.
Thank you. Marian Knezek