TAR = Tape Archive but it is essentially the native linux format of creating an archive. Gzip = Compressed. Together a Gzipped Tar is the linux equivalent of a Zip.
To create a gzipped TAR archive of all files in the current directory do this:
tar -czvf archive.tgz *
to tar-gz the xfiles folder into xarchive.tgz do:
tar -czvf xarchive.tgz xfiles/
To extract the archive contents to the current directory do:
tar -xzvf archive.tgz
to extract to a specific existing dir do:
tar -xzvf archive.tgz -C /my/exisiting/path/
c
– create a archive file.
x
– extract a archive file.
v
– show the progress of archive file.
f
– filename of archive file.
t
– viewing content of archive file.
j
– filter archive through bzip2.
z
– filter archive through gzip.
r
– append or update files or directories to existing archive file.
W
– Verify a archive file.