mrsn0.3.0
auth
live

ss vs netstat: the translated runbook

netstat is legacy on modern Linux; ss replaces it flag for flag. The full mapping, the port-8080 hunt in one line, and the cases where netstat still wins.

2026-11-233 min read

ss vs netstat: on modern Linux, ss is the standard, netstat legacy — often not installed. The flags map one to one: netstat -tlpn → ss -tlpn. Port hunt in one line: sudo ss -ltnp 'sport = :8080' — process name and PID come straight back.

ss vs netstat: the translated runbook

What you wantThe old lineThe new line
listening TCP + processnetstat -tlpnss -tlpn
all TCP + UDP connectionsnetstat -tulpnass -tulpna
routing tablenetstat -rip route
interface statisticsnetstat -iip -s link
kernel socket summary— no netstat answer —ss -s
filter by port, in-kernelgrep-and-prayss -tnp 'sport = :22'

The first two rows are identical: ss's short flags line up with netstat's for the common cases, so muscle memory mostly survives the move. Routing and interfaces moved to iproute2's ip route and ip -s link.

Is netstat deprecated?

On Linux, effectively yes. net-tools — netstat, ifconfig, route — no longer installs by default on any major distro. New features land only in iproute2, behind ss and ip.

  1. Missing on fresh installs. A default Ubuntu 24.04 or Fedora server has no netstat until you install net-tools by hand — which is why "the netstat equivalent" gets searched at all.
  2. No modern socket info. netstat predates TCP fast open, subflow-level socket stats and cgroup socket attribution. ss reports them natively.
  3. The Windows exception. On Windows, netstat -ano is still the standard way to map a PID to a listening port. Only the Linux story is deprecation.

The workhorse, flag by flag

ss means socket statistics — the kernel's view of every TCP, UDP and Unix socket.

# everything listening, with the owning process
sudo ss -tulpn

# established connections to/from port 443, with processes
sudo ss -tnp 'sport = :443 or dport = :443'

# how many sockets in each state
ss -s

TCP (-t), UDP (-u), listening only (-l), show processes (-p), numeric output / no DNS lookups (-n). sudo matters for -p: without root you see ports but no process names for sockets you don't own. The filter runs inside the kernel — exact, not text-matched. That's the upgrade over grep-and-pray.

Who owns port 8080?

8080

one line — sudo ss -ltnp 'sport = :8080' — and the process name and PID come straight back.

State   Recv-Q  Send-Q  Local Address:Port  Peer Address:Port  ProcessLISTEN  0       511     *:8080              *:*               users:(("node",pid=214113,fd=18))

The users:(...) field gives process name and PID directly — no second command. Port busy but no process? Usually a socket in another network namespace — a container; from the host the process column is empty, so match with docker ps or nsenter. sudo lsof -i :8080 -sTCP:LISTEN does the same job and works on macOS and most BSDs. Verify: the same command → users:(("node",pid=…)); swap in any port 1–65535.

Why is ss not found?

Either a pre-2007-era distro, or — far more likely — not Linux at all.

macOS ships lsof and netstat but no ss; same for the BSDs mostly. On Windows: netstat -ano or PowerShell's Get-NetTCPConnection. Genuinely Linux and missing: install iproute2 — sudo apt install iproute2 (Debian/Ubuntu) or sudo dnf install iproute2 (Fedora/RHEL). Verify: ss -V → a version string on the first line.

When netstat still earns its row

Two honest cases: portability across a mixed Linux, AIX or older-BSD fleet, and muscle-memory continuity in old runbooks. Otherwise default to ss and update the runbook.

flags in ss -tulpn
5
-t · -u · -l · -p · -n
Ubuntu release with no netstat by default
24.04
install net-tools by hand
ports the filter accepts
1–65535
swap in any one
The law: default to ss on Linux. Keep netstat for mixed-fleet portability and runbooks that still have net-tools installed.
  • tested on Ubuntu 24.04 · Fedora · Debian · iproute2 ss · Windows netstat -ano
  • first published 2026-09-05; record refreshed 2026-10-04
  • the sample ss -ltnp output is a real capture from a dev-server box — a node process on :8080 — retyped, not invented
0appreciations — anonymous, one per reader
your message opens the chat panel on the right — the thread remembers, sources ride inline
the feedanswersthe agentsdocsaboutauthschema.jsonopenapi.jsonllms.txt