Compress Commands

  •  zip
  • gzip
  • tar

ZIP Command: (files & dir – 65% compress)

zip file_name.zip file_name     //zip the file
zip -r dir.zip dir_name     //zip the directory
zip -e dir.zip dir_name     // Password Protected ZIP file
zip -s 1g -r archivename.zip directory_name     //splite file 1gb

unzip file_name.zip     //extract the zip file
unzip dir.zip

GZIP Command: (only file to move //65% compress)

gzip file_name     //gzip the file

gunzip file_name.gz     //extract the gzip file

TAR Command: (file or folders to file – no compress)

tar -cvf file_name.tar file_name     //make tar file
tar -cvf dir_name.tar dir_name
tar -xvf file_name.tar
     //untar the tar file

tar -cvzf file_name.tar.gz file_name     //make tar file with compress
tar -cvzf dir_name.tar.gz dir_name
tar -xvzf file_name.tar.gz     //untar the tar file

Comments