Command to Compress/Uncompress tar.gz and tar.bz2 files

Compress folder Test/ to Test.tar.gz

tar czfv Test.tar.gz Test/
czfv = ‘Compress Zip File Verbose’
If you want bzip files, use ‘j’ instead of ‘z’.

Uncompress Test.tar.gz to folder Test/

tar -xzf Test.tar.gz
x = ‘eXtract’
Again, if you want bzip files, use ‘j’ instead of ‘z’.

http://en.wikipedia.org/wiki/Tar_(file_format)

Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

6 thoughts on “Command to Compress/Uncompress tar.gz and tar.bz2 files

  1. You can use “tar czfv Test.tar.gz Test/” or “tar -czfv Test.tar.gz Test/” or “tar xzf Test.tar.gz” or “tar -xzf Test.tar.gz”.

    No matter, works the same 😉

Leave a Reply to Manjunath Cancel reply

Your email address will not be published. Required fields are marked *