A tgz or tar.gz file is a compressed archive of directories
and/or files that is prepared by tarring a directory, and then gzipping the resulting .tar file.
Simple tar file: tar -cf packedfiles.tar filetopack1 filetopack2 and so on...
to pack and compress:
tar -czf packedfiles.tgz filetopack1 filetopack2 and so on...to compress in gzip
and tar -cjf packedfiles.tgz filetopack1 filetopack2 and so on...to compress in bzip2 file format.
To unpack tar files
and uncompress gziped files, the command tar -xzf filetounpack.tar.gz
and uncompress bzip2ed files, tar -xjf filetounpack.tar.gz.bz2
tar and gzip are available on other operating systems, although the functionality of tar can be different. On a standard SunSolaris system, for instance, users can't use the j or z arguments on a tar command line to automatically compress the file into bzip2 or gzip format. The decompression and expansion must be broken down into two separate steps, although it is possible to use the Unixpipe capability to combine the two steps manually. However, it is possible to install the GNU version of tar on most systems that have this deficiency.
To pack
One step at a time
tar -cf packedfiles.tar filetopack1 filetopack2 ...