Create tar.gz of current directory and all subdirectories

Just another quick note to myself since I always forget to remember this.

To compress the whole of the entire current directory into a compressed tar/gz file:

	# tar cvz [--remove-files] -f mytarfile.tgz .

c == create
v == verbose
f == output file
z == compress
–remove-files == optionally remove files after adding them to the archive
. == current directory contents

To see what you’ve done:

	# tar --list -f mytarfile.tgz

I always forget to use the -f switch so it just sits there waiting for some magic input to arrive. What, am I supposed to type the contents of an archive for it to show me?

I always use tar vs. zip since tar remembers file permissions whereas zips do not (that may have changed, don’t care).