Tar archive mnemonic

I’ve always failed at remembering how to create and extract tar archives. But hey, why not create a mnemonic!?

Creating a tar.gz file:

Create Zip File

tar czf newarchive.tar.gz /path/to/file

Extracting

eXtract Zip File

tar xzf somearchive.tar.gz

You can of course add the v option to turn on the verbose mode. eg: 

tar xzfv somearchive.tar.gz

Or add a -C option to explicitly mention where you’d like the archive to extract to, like this: 

tar xzf somearchive.tar.gz -C ~/ws
Post a comment or leave a trackback: Trackback URL.

Comments

Leave a Reply

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