Privacy Policy
© 2025 linux101.dev

ss (Socket Statistics)

The ss command is a powerful utility used to investigate sockets. It is the modern replacement for the classic netstat command, providing more detailed information and running faster.

Common `ss` Commands

Display Listening Ports & Processes

ss -tlnp

Displays listening TCP ports and the processes using them.

Flag breakdown:
  • -t → Show only TCP connections.
  • -l → Show only listening ports.
  • -n → Do not resolve service names (faster).
  • -p → Show the process ID (PID) and name.

Show Active TCP Connections

ss -tn

A quick way to see all established TCP connections, without waiting for name resolution.

Show Active UDP Connections

ss -un

Lists all active UDP connections.

Show All Sockets

ss -a

Displays all sockets (both listening and non-listening) for all protocols.

Show Unix Sockets

ss -x

Displays active Unix Domain Sockets, which are used for inter-process communication on the same machine.