To identify which process is listening on a TCP port in Linux, use the netstat
or ss
commands.
- Using netstat:
This shows listening ports. To include process details, use:
- Using ss (faster alternative):
To get process information with
ss
, run:
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.