================================================================================
                                      tar
================================================================================

Glossary:
  Archive: store multiple files in a single one.
  Compressed file: reduced-size file made with compressing utilities.

Key concepts:
  Archives are used to regroup multiple files into a single one. It can then be
  copied to any place and unarchived there. It is different from a compressed
  archive where the archive is also compressed to make it takes less space on
  disk. Such archive are convenient but are less manipulable (add, delete file
  in the archive). An archive is comonly defined with the suffix .tar. A
  compressed archive can then be identified with a suffix .tar.gz indicating the
  compressing algorithm used.
  Archive can be compressed as any file using different compressing algorithm.
  Given commands can be replacing with the according option (-z: gzip, -Z:
  compress, ...). Note that these are not tied with the tar utility. A .tar.gz
  archive can be uncompressed normally with gzip (gunzip) before manipulating it
  with tar (with a .tar file).

--------------------------------------------------------------------------------
Creating an archive
--------------------------------------------------------------------------------

$ tar -cf archive_name.tar /path/to/file_or_directory

Compressed:
gzip:
$ tar -czf archive_name.tar.gz /path/to/file_or_directory

--------------------------------------------------------------------------------
Extracting an archive
--------------------------------------------------------------------------------

$ tar -xf archive_name.tar

Compressed:
gzip:
$ tar -xzf archive_name.tar.gz

--------------------------------------------------------------------------------
Adding file to an archive
--------------------------------------------------------------------------------

$ tar -rf archive_name.tar file1.txt

To add a file to a compressed archive, you must uncompress it first.
$ gunzip archive_name.tar.gz
$ tar -rf archive_name.tar file1.txt

--------------------------------------------------------------------------------
Listing content of an archive
--------------------------------------------------------------------------------

$ tar -tf archive_name.tar

Compressed:
gzip:
$ tar -tzf archive_name.tar.gz

--------------------------------------------------------------------------------
