How to find out opened ports on Linux system

How to find out what are the port’s opened on your system

It may occurs in many situation to find out what are the open ports available in the system. In this post i will explain you how to view what are the ports opened.

 

netstat command to find open ports :

 

To view all Listining ports in the system
#netstat –listen

 

To view all listening tcp ports with processID and program
#netstat -ntpl

To view all listening tcp ports with processID and program
#netstat -nupl

 

To view all listening and non-listening tcp ports
#netstat -atnp

 

To view all listening and non-listening udp ports
#netstat -aunp

 

To list all opened ports

#lsof -i