HostOnNet Blog

List of open ports in command line

Looking for Linux Server Admin or WordPress Expert? We can help.

If a port is open, it means that there is an actively running program which uses the port number to communicate with other programs. If you want to check which ports are open on Linux system, you can use netstat command.

# netstat -ntulp 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:48000               0.0.0.0:*                   LISTEN      9548/nimbus(control 
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      829219/dovecot      
tcp        0      0 0.0.0.0:48001               0.0.0.0:*                   LISTEN      9691/nimbus(spooler 
tcp        0      0 0.0.0.0:2082                0.0.0.0:*                   LISTEN      834581/cpsrvd (SSL) 
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      829219/dovecot      
tcp        0      0 0.0.0.0:3333                0.0.0.0:*                   LISTEN      205511/sshd         
tcp        0      0 0.0.0.0:2086                0.0.0.0:*                   LISTEN      834581/cpsrvd (SSL) 
tcp        0      0 0.0.0.0:2087                0.0.0.0:*                   LISTEN      834581/cpsrvd (SSL) 
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      389160/mysqld       
tcp        0      0 0.0.0.0:587                 0.0.0.0:*                   LISTEN      829308/exim         
tcp        0      0 0.0.0.0:54125               0.0.0.0:*                   LISTEN      9750/nimbus(process 
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      829219/dovecot      
tcp        0      0 0.0.0.0:2095                0.0.0.0:*                   LISTEN      834581/cpsrvd (SSL) 
tcp        0      0 127.0.0.1:783               0.0.0.0:*                   LISTEN      829342/spamd.pid -- 
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      829219/dovecot      
tcp        0      0 0.0.0.0:55727               0.0.0.0:*                   LISTEN      9731/nimbus(cdm)    
tcp        0      0 0.0.0.0:2096                0.0.0.0:*                   LISTEN      834581/cpsrvd (SSL) 
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      79129/httpd         
tcp        0      0 0.0.0.0:57296               0.0.0.0:*                   LISTEN      9712/nimbus(hdb)    
tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN      829308/exim         
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      8103/pure-ftpd (SER 
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      829308/exim         
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      10638/named         
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN      79129/httpd         
tcp        0      0 0.0.0.0:2077                0.0.0.0:*                   LISTEN      834785/cpdavd - acc 
tcp        0      0 0.0.0.0:2078                0.0.0.0:*                   LISTEN      834785/cpdavd - acc 
tcp        0      0 :::3333                     :::*                        LISTEN      205511/sshd         
tcp        0      0 :::587                      :::*                        LISTEN      829308/exim         
tcp        0      0 :::80                       :::*                        LISTEN      79129/httpd         
tcp        0      0 ::1:53                      :::*                        LISTEN      10638/named         
tcp        0      0 :::21                       :::*                        LISTEN      8103/pure-ftpd (SER 
tcp        0      0 :::25                       :::*                        LISTEN      829308/exim         
tcp        0      0 :::443                      :::*                        LISTEN      79129/httpd         
udp        0      0 119.81.9.253:123            0.0.0.0:*                               7685/ntpd           
udp        0      0 0.0.0.0:48000               0.0.0.0:*                               9548/nimbus(control 
udp        0      0 119.81.9.253:53             0.0.0.0:*                               10638/named         
udp        0      0 119.81.9.252:53             0.0.0.0:*                               10638/named         
udp        0      0 119.81.4.114:53             0.0.0.0:*                               10638/named         
udp        0      0 10.64.19.130:53             0.0.0.0:*                               10638/named         
udp        0      0 127.0.0.1:53                0.0.0.0:*                               10638/named         
udp        0      0 :::123                      :::*                                    7685/ntpd           
udp        0      0 ::1:53                      :::*                                    10638/named    

For security issues ports that are unused are closed generally by the firewall.

The following example List all open ports and listening services.

# netstat -an | grep LISTEN | grep -v unix
tcp        0      0 0.0.0.0:48000               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:48001               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2082                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2083                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:3333                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2086                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2087                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:587                 0.0.0.0:*                   LISTEN      
tcp        0      0 119.81.4.114:62092          0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:54125               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2095                0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:783               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:55727               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2096                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:57296               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN      
tcp        0      0 119.81.4.114:20533          0.0.0.0:*                   LISTEN      
tcp        0      0 119.81.9.253:53             0.0.0.0:*                   LISTEN      
tcp        0      0 119.81.9.252:53             0.0.0.0:*                   LISTEN      
tcp        0      0 119.81.4.114:53             0.0.0.0:*                   LISTEN      
tcp        0      0 10.64.19.130:53             0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      
tcp        0      0 119.81.4.114:32695          0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN      
tcp        0      0 119.81.4.114:64892          0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2077                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:2078                0.0.0.0:*                   LISTEN      
tcp        0      0 :::3333                     :::*                        LISTEN      
tcp        0      0 :::587                      :::*                        LISTEN      
tcp        0      0 :::80                       :::*                        LISTEN      
tcp        0      0 :::465                      :::*                        LISTEN      
tcp        0      0 ::1:53                      :::*                        LISTEN      
tcp        0      0 :::21                       :::*                        LISTEN      
tcp        0      0 :::25                       :::*                        LISTEN      
tcp        0      0 :::443                      :::*                        LISTEN      

About Annie

I've been working in Technical Section for over 10 years in a wide range of tech jobs from Tech Support to Software Testing. I started writing blog for my future reference and useful for all.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.