Networking

netstat

Displays network connections and routing information.

netstat is an older networking inspection tool. ss and ip are preferred on modern Linux systems, but netstat still appears in documentation.

Syntax
netstat [options]

Arguments explained

  • Options adjust output or behavior.
  • Arguments name the files, services, hosts, or values the command should work with.

Common examples

Show listening TCP ports
netstat -tlnp

Lists listening TCP ports with processes when permitted.

Show routes
netstat -rn

Displays the routing table numerically.

netstat Command
FieldDetails
Commandnetstat
CategoryNetworking
Primary useDisplays network connections and routing information.
Syntaxnetstat [options]