Gzip
Type following command to compress a file at shell prompt
gzip filename.ext -> The file will be compressed and save as filename.ext.gz
Type following command to expand a compressed file
gunzip filename.ext.gz -> The filename.ext.gz is deleted and replace with filename.ext
Type following command to compress multiple files at shell prompt
gzip filename.gz file1 file2 file3 -> will compress file1, file2, file3 into filename.gzip.
Zip
Type following command to compress a file at a shell prompt
zip -r filename.zip files -> filename.zip represents new zip file, files represents files need to be compressed
Type following command to expand a compressed file
unzip filename.zip
Type following command to compress multiple files at shell prompt
zip filename.zip file1 file2 file3 -> will compress file1, file2, file3 into filename.zip
Add directory to multiple files
zip filename.zip file1 file2 file3 /user/work/school -> will compress file1, file2, file3, /user/work/school directory content into filename.zip
Related posts:





[...] http://twoseven.co.nz/?p=109 – bookmarked by 6 members originally found by plowna on 2008-08-30 Compressing with GZip and Zip in CentOS http://pixert.com/2008/05/15/compressing-with-gzip-and-zip-in-centos/ – bookmarked by 1 [...]