From df5c384f385a8d4e260e47f08d6642d0780ed46f Mon Sep 17 00:00:00 2001 From: Alexis Ben Miloud--Josselin Date: Wed, 16 Nov 2022 11:53:05 +0100 Subject: [PATCH] =?UTF-8?q?tipsshell:=20am=C3=A9liorer=20exemple=20history?= =?UTF-8?q?=20expansion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TipsShell.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/TipsShell.md b/TipsShell.md index c097c1f9..0ecedf9b 100644 --- a/TipsShell.md +++ b/TipsShell.md @@ -162,20 +162,29 @@ Les éléments suivants permettent de rappeler des bouts des commandes précéde Exemple : -> TODO faire un meilleur exemple. - ~~~ $ echo a b c a b c -$ echo !! d -echo echo a b c d +$ !! d echo a b c d -$ ^d^D^ -echo echo a b c D -echo a b c D -$ echo !:2 !$ -echo a D -a D +a b c d +$ echo !$ +echo d +d +$ !-3 +echo a b c +a b c + +$ # copier un fichier puis l’éditer +$ cp -p file file.old +$ vi !:2 +vi file + +$ # lister puis extraire le contenu d’une archive +$ tar --list --file mon-archive.tar +[…] +$ ^list^extract^ +tar --extract --file mon-archive.tar ~~~ # Fichiers et FS