Saturday, January 11, 2025
HomeProgrammingHow do I find out which process is listening on a TCP

How do I find out which process is listening on a TCP

To identify which process is listening on a TCP port in Linux, use the netstat or ss commands.

  1. Using netstat:
    bash
    sudo netstat -tuln

    This shows listening ports. To include process details, use:

    bash
    sudo netstat -tulnp
  2. Using ss (faster alternative):
    bash
    sudo ss -tuln

    To get process information with ss, run:

    bash
    sudo ss -tulnp

These commands show the PID and associated program. Use ps to identify the process name by PID for more details. This helps track down services listening on specific TCP ports.

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x