how to find proces listening on a port

28 views
Skip to first unread message

Srikrishna Murthy Annam

unread,
Feb 25, 2014, 1:09:29 AM2/25/14
to askm...@googlegroups.com
netstat , fuser , lsof , /proc/$pid
# netstat -tulpn
# ls -l /proc/1138/exe 
# fuser 7000/tcp
lsof -i :portNumber
lsof -i tcp:portNumber
lsof -i udp:portNumber
lsof -i :80
lsof -i :80 | grep LISTEN

grep 443 /etc/services

Other useful commands lsof:
Specific user opened files : # lsof -u askm
Process running on specific port : lsof -i TCP:22
port range :  lsof -i TCP:1-1024
Exclude User :  lsof -i -u^root
who is looking what file :  lsof -i -u askm
Kill all activities of a user : kill -9 `lsof -t -u askm`


Reply all
Reply to author
Forward
0 new messages