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