ss / netstat Commands

Complete ss / netstat commands reference — 55 commands across 3 categories. Quick reference cheat sheet for Linux.

Options (44)

ShortcutAction
ss -hShow summary of options
ss -VOutput version information
ss -HSuppress header line
ss -QSuppress sending and receiving queue columns
ss -OPrint each socket's data on a single line
ss -nDo not try to resolve service names
ss -rTry to resolve numeric address/ports
ss -aDisplay both listening and non-listening (for TCP this means established connections) sock
ss -lDisplay only listening sockets (these are omitted by default)
ss -BDisplay only TCP bound but inactive (not listening, connecting, etc.) sockets (these are o
ss -oShow timer information
ss -eShow detailed socket information
ss -mShow socket memory usage
ss -pShow processes using sockets
ss -TShow threads using sockets
ss -iShow internal TCP information
ss --tosShow ToS and priority information
ss --cgroupShow cgroup information
ss --tipcinfoShow internal tipc socket information
ss -KAttempts to forcibly close sockets
ss -sPrint summary statistics
ss -EContinually display sockets as they are destroyed
ss -ZAs the -p option but also shows process security context
ss -zAs the -Z option but also shows the socket context
ss -N NSNAMESwitch to the specified network namespace name
ss -bShow socket classic BPF filters (only administrators are allowed to get this information)
ss -4Display only IP version 4 sockets (alias for -f inet)
ss -6Display only IP version 6 sockets (alias for -f inet6)
ss -0Display PACKET sockets (alias for -f link)
ss -tDisplay TCP sockets
ss -uDisplay UDP sockets
ss -dDisplay DCCP sockets
ss -wDisplay RAW sockets
ss -xDisplay Unix domain sockets (alias for -f unix)
ss -SDisplay SCTP sockets
ss --vsockDisplay vsock sockets (alias for -f vsock)
ss -MDisplay MPTCP sockets
ss --inet-sockoptDisplay inet socket options
ss -f FAMILYDisplay sockets of type FAMILY
ss -A QUERYList of socket tables to dump, separated by commas
ss -D FILEDo not display anything, just dump raw information about TCP sockets to FILE after applyin
ss -F FILERead filter information from FILE
ss --bpf-mapsPretty-print all the BPF socket-local data entries for each socket
ss --bpf-map-id=MAP_IDPretty-print the BPF socket-local data entries for the requested map ID

Filter Expressions (6)

ShortcutAction
{dst|src} [=] HOSTTest if the destination or source matches HOST
{dport|sport} [OP] [FAMILY:]:PORTCompare the destination or source port to PORT
dev [=|!=] DEVICEMatch based on the device the connection uses
fwmark [=|!=] MASKMatches based on the fwmark value for the connection
cgroup [=|!=] PATHMatch if the connection is part of a cgroup at the given path
autoboundMatch if the port or path of the source address was automatically allocated (rather than e

Usage Examples (5)

ShortcutAction
ss -t -aDisplay all TCP sockets
ss -t -a -ZDisplay all TCP sockets with process SELinux security contexts
ss -u -aDisplay all UDP sockets
ss -x src /tmp/.X11-unix/*Find all local processes connected to X server
ss -a -A 'all,!tcp'List sockets in all states from all socket tables but TCP
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Related Shortcut Pages

tcpdump Nmap Nginx Docker Kubernetes (kubectl) htop

Search 13,500+ shortcuts across 269 platforms

Explore All Platforms Practice Shortcuts
📜 Every shortcut on this page is taken from the official ss / netstat documentation — man7.org
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

🤖 Ask AI about ss / netstat shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok