tar examples

tar is used to collect all files in a directory into one file, which you can then save or transfer to another machine (e.g., using scp).

To create a tar file of your cs21 directory:

tar cvf cs21.tar cs21

To untar a given tarfile, into the current directory:

tar xvf myfile.tar

To untar a gzipped tarfile:

tar xvzf myfile.tar.gz

For the above examples, the general syntax is:

tar options tarfile [directory to tar]

where the options are:


Back to SwatCS Help Docs