Create and extract a .tar.gz archive using command line

Create and extract a .tar.gz archive using command line

To create a tar.gz archive from a given folder you can use the following command

This will compress the contents of source-folder-name to a tar.gz archive named tar-archive-name.tar.gz

To extract a tar.gz compressed archive you can use the following command

This will extract the archive to the folder tar-archive-name.


To Preserve permissions

Switch the ‘c’ flag to an ‘x’ to extract (uncompress).

About The Author

Brett Popoleo
I am a web designer, Drummer and web application developer from Pittsburgh PA. I love to create unique and functional websites for business, personal use, or anything in between. If you need a corporate design for your business, a shopping cart for your store, or even a unique design for your blog, give me a call or contact me here and we can start to work together.

No Comments

Leave a Reply