Yes, you got it right. Tar puts all files from a directory, including its sub-directories, ownership and access-rights, in a single . tar file. The 'z'-option compresses the .tar file using gzip, thus creating a .tar.gz.
tar czvf some_name.tar.gz some_dir
is the same as:
tar cvf some_file.tar some_dir
...and then compressig it with:
The same goes for un-tarring (and decompressing), in the opposite order, like:
tar xvf some_file.tar
tar xzvf some_file.tar.gz
The 'v' options tells 'tar' to be verbose, i.e. leaving the 'v' option out will do exacly the same thing, but silently.
And, yes, "aFile.tgz" is the same as "aFile.tar.gz".
Today often tar-files are compressed with "bzip2". The files are named like "aFile.tar.bz2". You can decompress them with "bunzip2", or in one go (with recent tar versions) with the 'j' or 'I' (capital 'i') option (depends on your tar-version) instead of 'z'. Like
tar cjvf some_name.tar.bz2 some_dir
tar cIvf some_name.tar.bz2 some_dir
Last edited by Hko; 09-07-2002 at 10:49 PM.