Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Find out which programs are listening TCP port

Answer:

Use the command: netstat -tlnp

# netstat -tlnp

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
  1. What is the difference between ip address 0.0.0.0 and 127.0.0.1?
  2. Show the Domain Name Servers for a domain
  3. Check the number of active Apache connection
  4. Kill all processes listening on a particular port
  5. Check for the number of connection from a particular IP address

2 Responses to “Find out which programs are listening TCP port”

  1. Where is the program listed? I don't think your answer answers the question...

  2. @Mike

    What distribution you are using?

    If you are using Debian based, you can install netstats by

    # sudo apt-get install net-tools

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>