Tag Archives: tar

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 <em>czf</em> newarchive.tar.gz /path/to/file

Extracting

eXtract Zip File

tar <em>xzf</em> somearchive.tar.gz

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

tar xzfv <em>somearchive.tar.gz</em>

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

tar xzf <em>somearchive.tar.gz</em> -C ~/ws