Linux – How Do You Check Which Programs Are Using Network Ports?
If you're running things like web servers, media servers, Docker containers or other services on Linux, eventually you can run into a situation where a program refuses to start because the port it needs is already in use.One useful command for checking listening ports is:
sudo ss -tulpn
You can also check a particular port, for example port 9000:
sudo ss -tulpn | grep :9000
This can quickly show whether something is already listening on that port and which process is responsible.
I've found this particularly useful when dealing with several services running on the same machine.
What do you normally use for checking ports on Linux?
Do you use ss, lsof, netstat, or something else?
Any other useful networking commands worth knowing?