Linux How to Zip
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 compresses one or more files into the name.zip archive. Zip has options from “1” to “9”. Option -1 use for 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:
To decompress to a specific directory use the “d” option:
unzip name.zip -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