Sitemap
Nirbhay Singh

Nirbhay Singh

Technophile, Assistant Vice President at CITI, talks about AI, DevOps, Cloud, SRE, Linux and Programming. https://buymeacoffee.com/nirbhaysingh281

Member-only story

netstat Examples

2 min readAug 24, 2025

--

netstat is like a CCTV camera for your network. It shows which ports are open, which apps are listening, and who is connected.

✅ netstat Examples for Practice

1. Show all listening ports

netstat -tuln
  • t → TCP connections
  • u → UDP connections
  • l → listening sockets
  • n → numeric (IP/port instead of hostname)

👉 Practice: Check if SSH (22) and HTTP (80) are listening.

2. Show all connections (listening + established)

netstat -a
  • Displays everything (listening + active connections).

3. Show which process is using a port

netstat -tulpn
  • p → show process using the socket.

4. Show only TCP connections

netstat -tn

5. Show only UDP connections

netstat -un

6. Show routing table (like route -n)

netstat -rn
  • Displays kernel routing table.
  • Useful to check default gateway.

7. Show network statistics (sent/received packets)

--

--

Technophile, Assistant Vice President at CITI, talks about AI, DevOps, Cloud, SRE, Linux and Programming. https://buymeacoffee.com/nirbhaysingh281