A ".tar" file is a collection of files within a single file in an uncompressed form. If the file is a ".tar.gz" ( usually called tarball) or ".tgz" file then it is a collection of files in a compressed form.
To compress a file you could create the tar file with the
zoption. Or alternatively you could create the file with any other tool and then use
gzipto compress it.
Some Tar Options
c: create a new archive
d: delete from the archive
r: append files to the end of the archive
t: list contents
u: update (append files if newer)
# target file is a zipped tar ball $ tar -zxvf file.tar.gz # target file is simply a tar ball $ tar -xvf file.tar
Listing contents of the file
$ tar -tvf myfile.tar
# tar contents of folder foo in foo.tar $ tar -cvvf foo.tar foo/That is all, maybe I add more options as needed.