Archiving/Unarchiving with tar

NOTE: this website is under construction for the new quarter. Please pardon our dust! The content of this website is subject to change as we put together resources for the new quarter. If you are a student who took the course last quarter, you should visit last quarter's class web site instead, accessible by visiting this link.

Written by Chris Gregg, with modifications by Nick Troccoli

Click here for a walkthrough video.

Although you won't directly use it in CS107, sometimes you will find files on a linux system that have the extension ".tgz" or ".tar.gz". These are compressed (like "zipped") files, and you use the tar ("Tape ARchive", from back when we routinely used magnetic tape to keep backups program to extract the files.

The easiest way to un-tar a file is to use the command with the -xvf flags:

$ tar -xvf file.tar.gz
...lots of files
$

To create an archive file that is compressed, use the -czvf flags:

$ tar -czvf file.tar.gz someFolder
...lots of files added
$