From ed0a04b444015f6c5b66c0bc203119091ede59f8 Mon Sep 17 00:00:00 2001 From: pdiogoantunes Date: Mon, 18 Sep 2017 10:42:00 +0200 Subject: [PATCH] =?UTF-8?q?lister=20rep=20sur=20le=20m=C3=AAme=20FS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TipsShell.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TipsShell.md b/TipsShell.md index a33b7b62..2fac2bf8 100644 --- a/TipsShell.md +++ b/TipsShell.md @@ -118,6 +118,12 @@ $ (for host in machine1 machine2 ...; do echo $host; timeout -k 2 2 ssh -o 'Stri ## Ordinaire +### Lister les répertoires monté sur le même FS + +~~~{.bash} +ROOT=/; get_fs(){ df $1 | tail -n1 | awk '{print $1}'; }; fs_root="$(get_fs $ROOT)"; for file in $(ls -1 $ROOT); do [ "$(get_fs $ROOT$file)" = "$fs_root" ] && echo "$ROOT$file"; done | xargs du -sch +~~~ + ### Savoir si lignes en doublon dans un fichier ~~~{.bash}