solairis.com

Tar Notes

Create archive:

tar -cf my.tar list of files wildcards are cool

Un-archive into current directory:

tar xf my.tar

Create archive and compress with gzip:

tar -czf my.tar.gz list of files

Un-archive gzipped tar:

tar zxf my.tar.gz

Create archive, excluding certain directories (maybe they are really big and unnecessary):

tar --exclude="location/of/dir/to/leave/out" --exclude="location/of/another/dir/to/leave/out" -cf my.tar list of files

Tips

Add the v (verbose) flag to any command to see what is happening.