$linuxjunkies
>

ss(8)

Display socket statistics and network connection information, replacing the deprecated netstat command.

UbuntuDebianFedoraArch

Synopsis

ss [OPTION]... [FILTER]

Description

The ss command shows socket statistics for TCP, UDP, and other protocols. It's faster and more detailed than netstat, using information from the kernel's /proc filesystem. Use it to diagnose network connections, listening ports, and socket states.

Filters can be applied by protocol (tcp, udp, raw), state (ESTABLISHED, LISTEN), or address:port combinations. Output includes local/remote addresses, port numbers, and connection states.

Common options

FlagWhat it does
-tShow TCP sockets only
-uShow UDP sockets only
-lDisplay listening sockets
-aShow all sockets (listening and established)
-pShow process name and PID associated with each socket
-nDon't resolve service names; display numeric port numbers
-eShow detailed socket information (extended)
-iShow TCP internal information (RTT, advmss, etc.)
-mShow socket memory usage
-oShow timer information (retransmit timers, keepalive)
-sShow summary statistics instead of listing sockets
-4Show IPv4 sockets only

Examples

List all TCP listening sockets with numeric ports and process information

ss -tlnp

Show all listening TCP and UDP sockets with processes and numeric output

ss -tulnp

Display all established TCP connections in numeric format

ss -tan | grep ESTABLISHED

Find which process is listening on port 8080

ss -plnt dst :8080

Show summary statistics for all socket types

ss -s

List established TCP connections with internal info (RTT, window size)

ss -tni state established

Show UDP sockets related to DNS port 53

ss -u | grep :53

Display all TCP sockets with memory usage information

ss -tam

Related commands