Hello. My name's Kate. I love Linux, WordPress - owned a WordPress dedicated design studio, a beginner entrepreneur who co-founded Asia software company. This is where i blog about Linux, WordPress, daily life and other interesting stuff
Status: -

You are on the Nineteen Labs » Compressing with GZip and Zip in CentOS article.

Compressing with GZip and Zip in CentOS

Gzip
Type the following command to compress a file at a shell prompt
gzip filename.ext -> The file will be compressed and saved as filename.ext.gz

Type the following command to expand a compressed file
gunzip filename.ext.gz -> The filename.ext.gz is deleted and replaced with filename.ext

Type the following command to compress multiple files at a shell prompt
gzip filename.gz file1 file2 file3 -> will compress file1, file2, file3 and put them in filename.gzip.

Zip
Type the following command to compress a file at a shell prompt
zip -r filename.zip files -> filename represents the file you are creating and files represents the files you want to put in the new file

Type the following command to expand a compressed file
unzip filename.zip

Type the following command to compress multiple files at a shell prompt
zip filename.zip file1 file2 file3 -> will compress file1, file2, file3 and put them in filename.zip

If you add directory to multiple files
zip filename.zip file1 file2 file3 /user/work/school -> will compress file1, file2, file3, the contents of the /user/work/school directory and put them in filename.zip

Share : These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • SphereIt
  • BlinkList
  • Reddit
  • StumbleUpon

Leave a Reply

This site powered : WordPress. Made with PC (sorry, MAC), Coffee and Tofu