From 49e5e02d737e7ca380db04e3fac1702b9b847c34 Mon Sep 17 00:00:00 2001 From: pdiogoantunes Date: Tue, 21 Mar 2017 17:24:13 +0100 Subject: [PATCH] Ajout process socket --- TipsShell.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/TipsShell.md b/TipsShell.md index 5619fe3e..ea025a43 100644 --- a/TipsShell.md +++ b/TipsShell.md @@ -161,4 +161,18 @@ Ou regarder les IPs en direct : ~~~ # SEUIL=5; tail -f /var/log/apache2/access.log | stdbuf -oL cut -d ' ' -f1 | stdbuf -oL uniq -c | \ eval "awk '\$1 > $SEUIL {printf \"\\033[1;31m\" \$1 \" \" \$2 \"\\033[0m \\n\"; next;};{printf \$1 \" \" \$2 \"\\n\";}'" +~~~ + +## Un processus par rapport à la socket + +- Connaître les sockets ouvertes et ports en écoutent par un processus : + +~~~{.bash} +$ lsof -Pan -p PID -i +~~~ + +- Connaître le pid qui écoute sur un port (2ème colonne) : + +~~~{.bash} +$ lsof -i :Port ~~~ \ No newline at end of file