ss
Utility to investigate socket connections, replacing legacy netstat.
Common Options & Flags
| Option / Flag | Description |
|---|---|
| -t | Display TCP sockets |
| -u | Display UDP sockets |
| -l | Display listening sockets only |
| -p | Show process using socket (requires root) |
| -n | Do not resolve service names (show numeric ports) |
Practical Command Examples
List all listening TCP and UDP sockets with numeric port numbers and associated PIDs.
Check which process is listening on HTTP port 80.
Production Real-World Use Case
Diagnosing port binding conflicts, checking listening services, and verifying firewall bindings.
Common Mistakes
- ✕Running without sudo, which hides process names (Users/PIDs) bound to ports.
Security Considerations
Audit all open listening ports to shut down unnecessary public listeners.