Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux ss command

Show socket information. The flags below list listening TCP and UDP ports.

iproute2

Syntax

Command form
ss [OPTIONS] [FILTER]

Common options

7 options
OptionWhat it does
-t, --tcpDisplay TCP sockets.
-u, --udpDisplay UDP sockets.
-l, --listeningDisplay listening sockets.
-n, --numericDo not resolve service names or addresses.
-p, --processesShow the process using each socket (permissions may limit details).
-a, --allDisplay listening and non-listening sockets.
-s, --summaryPrint socket usage summary.

Usage examples

3 examples

Show socket information. The flags below list listening TCP and UDP ports.

ss -tuln

Show listening TCP/UDP sockets and associated processes.

ss -tulpn

List established TCP connections numerically.

ss -tan state established

Notes

Process names may be hidden without sufficient privileges. Socket filters have their own syntax; check the manual for complex expressions.