From cc13e6bec63064dbc2d7c390a91156fec35c87c1 Mon Sep 17 00:00:00 2001 From: Alexis Ben Miloud--Josselin Date: Mon, 6 Feb 2023 10:50:15 +0100 Subject: [PATCH] =?UTF-8?q?TipsShell:=20cr=C3=A9er=20archive=20avec=20tar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TipsShell.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TipsShell.md b/TipsShell.md index 34a365a5..5d0a3411 100644 --- a/TipsShell.md +++ b/TipsShell.md @@ -271,6 +271,16 @@ Connaître la taille totale des derniers fichiers copiés : $ find /path/ -type f -mtime -1 -printf "'%p' " | xargs du -ch ~~~ +### Archiver + +~~~ { .bash } +tar --create --file archive.tar --verbose -- directory +tar --create --file archive.tar --exclude='directory/subdir' --verbose -- directory +tar --create --file archive.tar --exclude='directory/subdir/*.mp3' --verbose -- directory +~~~ + +> Lorsqu'on exclut un répertoire, il ne faut pas mettre de `/` à la fin du chemin. + ## Droits ### Changer propriétaires owner et group selon actuels