A service fails to start with an error such as:
Another service appears healthy, but nothing is accepting connections on its expected port. A server has thousands of TCP connections, but it is unclear which process owns them. These problems begin with the same questions:
On Unix-like systems, three command-line tools answer different parts of those questions:
ss is the primary Linux tool for inspecting socket state.netstat provides similar information and remains useful on systems where ss is unavailable.lsof connects sockets to processes and their open file descriptors.These tools inspect the local host. They do not capture packets, query a remote machine, or prove that a listener is reachable through a firewall. Their strength is showing what the local kernel and local processes know at one instant.