07/22/2022 14:03 | Category: linux

Tags: networkslocalhostports

linux net tools for diagnosing errors in port bindings

When checking for the currently used ports to check for any blockers we can use a tool called net-tools.

The tool returns a list of currently used port mappings to help diagnose the port that is currently being consumed.

I encountered the need for this when working with a Docker application that required a common port, I was able to find an Apache2 server running on that port mapping that I terminated.

StackOverflow reference

Example usage and installation

sudo apt install net-tools

# returns non-privileged user processes
sudo netstat -pna | grep <your port number>

# returns all processes
sudo netstat -pna | grep <your port number>