Zip file/folder in terminal

Use tar:

  • Compress multifile to folder:

tar -cvf – file1.txt file2.txt | gzip > file-zip-name.tar.gz

  • Compress folder:

tar -zcvf file-zip-name.tar.gz folder_want_zip

  • Unzip

tar -xvzf file-zip-name.tar.gz

Advertisements