Outils pour utilisateurs

Outils du site


tech:shell_gnu_tar_-_commande_tar

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:shell_gnu_tar_-_commande_tar [2025/03/26 14:56] Jean-Baptistetech:shell_gnu_tar_-_commande_tar [2025/06/06 09:36] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 <!DOCTYPE markdown> <!DOCTYPE markdown>
-{{tag>Brouillon}}+{{tag>Brouillon Archive}}
  
 # Shell GNU tar - Commande tar # Shell GNU tar - Commande tar
Ligne 13: Ligne 13:
 ## Exemples / options ## Exemples / options
  
-### Exclusion+### Inclusion / Exclusion
  
 ~~~bash ~~~bash
Ligne 24: Ligne 24:
  
  
-### Spécifier le chemin racine - éviter 'cd'+Spécifier le chemin racine - éviter 'cd'
  
 Utiliser l'option ''-C'' pour indiquer le chemin Utiliser l'option ''-C'' pour indiquer le chemin
Ligne 38: Ligne 38:
  
  
-### Dot dir dossier point à la racine+#### Dot dir dossier point à la racine 
 + 
 +##### Creation d'archive
  
 Dossier "." (dot dir) à la racine de l'archive Dossier "." (dot dir) à la racine de l'archive
Ligne 52: Ligne 54:
  
 # Ou encore  # Ou encore 
-$ tar czvf ../plop.tar.gz --xform="s,./,," ./*+$ tar czvf ../plop.tar.gz --xform="s,^./,," ./*
  
 # Ou # Ou
-$ find . -printf "%P\n" | tar -czf ../plop.tar.gz --no-recursion -T -+#find . -print0  | tar -T - --null --no-recursion -czf ../plop.tar.gz 
 +$ find . -printf "%P\n"  | tar -czf ../plop.tar.gz --no-recursion -T - 
 + 
 +# Autre 
 +# find -mindepth 1 .
 ~~~ ~~~
 +
 +
 +##### Extraction d'archive
 +~~~bash
 +tar --strip-components 1 -xvf plop.tar.gz
 +~~~
 +
 +
 +
 +### Droits / permissions / owner
 +
 +GNU tar allows you not to preserve the owner and permissions.
 +~~~bash
 +tar -c -f archive.tar --owner=0 --group=0 --no-same-owner --no-same-permissions
 +~~~
 +
 +
 +
 +### Compression
 +
 +~~~
 +gzip: warning: GZIP environment variable is deprecated; use an alias or script
 +~~~
 +
 +L'ancienne commande 
 +~~~bash
 +GZIP=-9 tar -zcf ... files to compress ...
 +~~~
 +
 +Devient 
 +~~~bash
 +tar -I 'gzip -9' -cf ... files to compress
 +~~~
 +
  
  
Ligne 80: Ligne 120:
  
 # Mais faire : # Mais faire :
 +mv plop.tgz2 plop2.tgz
 pkgdiff -hide-unchanged plop.tgz plop2.tgz pkgdiff -hide-unchanged plop.tgz plop2.tgz
 ~~~ ~~~
tech/shell_gnu_tar_-_commande_tar.1742997410.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki