Description of tar command

Exemple de commandes Tar

 1# Deflate / Compress
 2$ tar -czf archive.tar.gz /path/files
 3
 4# Inflate / Uncompress
 5$ tar -xzf archive.tar.gz
 6
 7# Extract file to a defined directory
 8$ tar -xzf archive.tar.gz -C /target/directory
 9
10# Append a file to an existing archive
11$ tar -zu archive.tar.gz -C /target/file

Common options

  • z : compress with gzip
  • c : create an archive
  • u : append files which are newer than the corresponding copy ibn the archive
  • f : filename of the archive
  • v : verbose, display what is inflated or deflated
  • a : unlike of z, determine compression based on file extension