Ss
socket statistics
$ ss -tulpn
ss
: Short for "socket statistics," it's a command-line utility to investigate sockets on a system, displaying information about network connections, routing tables, and interface statistics.
-
-tulpn
: This is where the real magic happens:-t
: Filters the output to show only TCP sockets. Think of it as focusing your lens on TCP connections, ignoring everything else.-u
: Similarly, this filter narrows the output to UDP sockets. Like the 't' flag, but for UDP. Handy if you're into datagrams.-l
: Limits the display to only listening sockets. These are the ones that are open and waiting for incoming connections. Like a phone line waiting for a call.-p
: Shows the process using the socket. This flag reveals which program or service is responsible for each socket. It's like peeking behind the curtain to see who's pulling the strings.-n
: Displays numeric addresses instead of resolving them to hostnames. This can speed up the command's execution and make the output more concise. No need for fancy names, just raw numbers.