How to find which process are listening to perticular port or protocol like tcp or udp

Lsof command helps in finding which process are listening on a particular port or type of protocol they are using to connect. 


$ lsof -i :80
 
The above command will list all the application on the system which are listening on port 80 .

$ lsof  -i4 -i6 
The above command will list all the IPv4 and IPv6 based connection states for different applications in the system.

$ lsof -i tcp -i udp 

The above command will list all the TCP and UDP based connection states for different applications in the system.

Comments

Popular posts from this blog

How to disable USB ports on Mac OS X Mavericks, Yosemite or El Capitan ?