Tar Command

The TAR command is one of those built-in utilities that makes Linux (and of course UNIX) so great. It allows you to make an archive of a directory (or a series of files).

You would use it like so…

  1. cd to root folder
  2. tar -cvzf name.tgz dir

This makes a tar archive of dir.

  1. tar -xvf name.tgz

This will extract the archiveĀ  name.tgz wherever you are.

tar -xvf file.tar.gz -C /some/dir/

This will changeĀ  to /some/dir/ and extract file.tar.gz there.