Port is a piece of software which is used as a docking point in your computer, where remote application can communicate.  In linux services and their port number listed in /etc/services . In this article,  we explained how to find all open port in linux and which process listening on particular ports.  How to Find Which Process Listening on Particular Ports , we use many commands.

There are many command to find services and their port number. Here we will discuss about few command , which is used to find services and their port number.

1.  netstat –  Network statistics is a command line tools , that display active TCP connection, ethernet statistics, port on which computer is listening and routing table . It is available on linux, macOS , Windows , Solaris .

It is not installed by default. You should install it by using given command –

Once it is installed , you can use it to find port and their services.

The flags used in above command are –

l – Show only listening sockets.

n – show numerical addresses .

t – display tcp connection

p – show process ID and process name .

2.  lsof –  It stand for “list open files ” is a command used in most unix-type system to list all open files and the process that open them. By using lsof you can get information of any opened files.

simply type lsof to get information of all opened files 

Lists processes which open specific file

List files opened by specific user (amar)

List all network connection

3.  fuser –  It is a unix command , which is used to show which process are using a specific file or unix socket.

You may also like to read following article :

In this short article , we have explained how to find which process listening on particular ports.  Please subscribe to newsletter for updated articles. We will discuss about many other utility in next articles.