tar

intermédiaire

Crée et extrait des archives .tar(.gz).

tar regroupe des fichiers dans une archive, souvent compressée avec gzip (.tar.gz). Moyen mnémotechnique : c = créer, x = extraire, z = gzip, v = verbeux, f = fichier.

Syntaxe

tar [options] archive [fichiers]

Options & usages

-czvfCréer une archive .tar.gz.
-xzvfExtraire une archive .tar.gz.
-tzvfLister le contenu sans extraire.
-C dossierExtraire dans ce dossier.

Exemples

  • $ tar -czvf backup.tar.gz Documents

    Archive Documents

  • $ tar -xzvf backup.tar.gz

    Extrait l'archive

  • $ tar -xzvf a.tar.gz -C /tmp

    Extrait dans /tmp