From ed14a09c5631bf5c542e8109f460ac8abb118925 Mon Sep 17 00:00:00 2001 From: pdiogoantunes Date: Tue, 18 Apr 2017 16:43:26 +0200 Subject: [PATCH] Ajout script watch process --- TipsShell.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TipsShell.md b/TipsShell.md index 7adeb34a..43b1ff5b 100644 --- a/TipsShell.md +++ b/TipsShell.md @@ -312,4 +312,10 @@ Toutes les 5 secondes : ~~~{.bash} $ watch -n 5 -d "ps -e -o etimes=,pid,user,cmd | sort -n | awk '{if (\$1==0 || \$2==$$ || \$3~/watch/ || \$3~/\[.*\]/) {} else print \$0 }'" +~~~ + +Se baser seulement par rapport aux utilisateurs ayant créés dernièrement ces processus (SEUIL <=> processus vieux de moins de $SEUIL secondes) : + +~~~{.bash} +$ SEUIL=100; watch -n 5 -d "ps -e -o etimes=,user | sort -n | awk '{if (\$1<$SEUIL) print \$2 }' | sort | uniq -c | sort -n" ~~~ \ No newline at end of file