Unix Reference

tar (unarchive a .tgz or .tar.gz file)

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 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
$

Back to contents