Monday, June 18, 2012

Displaying All Active Internet Connections In Linux

Friends it is  necessary to display what Internet connections are active on your Linux machine. For example, seeing the Apache service is actively running or not, and if running what network ports it's listening to. To do this run the below netstat command in the command line.

netstat -natp



If you have root privileges running the above command will give an output similar to the below example.



Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 16271/hpiod
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 4917/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8030/apache2
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 15978/cupsd
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 16276/python
tcp6 0 0 :::5900 :::* LISTEN 5752/vino-server
tcp6 0 0 :::22 :::* LISTEN 5062/sshd
tcp6 0 148 ::ffff:192.168.2.102:22 ::ffff:192.168.2.1:3027 ESTABLISHED7534/sshd: hope [
tcp6 0 797 ::ffff:192.168.2.1:5900 ::ffff:192.168.2.1:2592 ESTABLISHED5752/vino-server


                                  
                           
                            
                   ***Thanks Friends***

No comments:

Post a Comment

Please Give Me Your Views

Popular Posts