ss – translated for netstat users
Since netstat version 1.4, man page says that netstat is obsolete, so We should use ‘ss’, but how?
I put here some tips here:
Show listening connections with process name and PID
sudo ss -ltp
Show all connections with process name and PID of each open connection
sudo ss -tp
Filter out tcp, udp
ss -A tcp
ss -A udp
Do not resolve hostname
Show only listening sockets
ss -ltn # For TCP
ss -lun # For UDP
Filtering connections by tcp state
# ss [ OPTIONS ] [ STATE-FILTER ] [ ADDRESS-FILTER ] #
ss -t4 state established
ss -t4 state time-wait
The state can be either of the following
- all : All of the above states
- connected : All the states except for listen and closed
- synchronized : All the connected states except for syn-sent
- bucket : Show states, which are maintained as minisockets, i.e. time-wait and syn-recv.
- big : Opposite to bucket state.
SysAdmin/DevOps Professional with strong Linux focus, experience with design and support of high availability webscale infrastructures and resilient database deployments.
Deep understanding of Linux, Cloud, Information Security and outsource support.
If you need to send me an encrypted mail. Please import my GPG key:
gpg –keyserver hkp://keyserver.ubuntu.com –recv-keys 63B19B1C52B7AC98033EAC670F6A2073E0EE5DC5
If this blog helps you, you could buy me a coffee: