May 14 2011

Archiving and extracting files using tar

I always have the hardest time remembering the command line options for tar.  Found a simple site that explains them concisely and figured I’d post the info here so I always know where to easily find it all.

To tar all files in a directory into a file named foo.tgz:

tar cvzf foo.tgz dir

To extract the contents of a tar:

tar xvzf foo.tgz

More information here.