Find the process listening on a port Get link Facebook X Pinterest Email Other Apps - August 04, 2020 Using netstat PORT=80; sudo netstat -ltnp | grep ":${PORT}" Using lsof PORT=80; sudo lsof -i :${PORT} Read more
Show connections per destination for a specific port Get link Facebook X Pinterest Email Other Apps - August 04, 2020 PORT=5432; netstat -an |grep ":${PORT} " | \ awk '{count[$5]++} END {for (host in count) print host, count[host]}' To view the same over time: PORT=5432; watch "netstat -an |grep \":${PORT} \" | \ awk '{count[\$5]++} END {for (host in count) print host, count[host]}'" Read more