Professional Documents
Culture Documents
1.
RobAdministrator
Staff Member
Joined:
Messages:
302
Likes Received:
788
If you find yourself looking at networking connections in Linux then you've probably used netstat
at some point. It's very useful to list out established connections, find out which ports your
server is listening on, etc..
Well, ss is a similar tool to netstat. Netstat itself even tells us to use ss instead in its man page!
Code:
NOTE
This program is obsolete. Replacement for netstat is ss. Replacement for
netstat -r is ip route. Replacement for netstat
-i is ip -s link. Replacement for netstat -g is ip maddr.
To get some better information out of ss, however, you can give it some options..
ss [options] [ FILTER ]
Wow - that showed quite a bit.. you'll see on the left hand side you have some established
connections, time-waits, etc..
Let's narrow this down a bit.. and only show the ports we're listening on. We'll use -l (listen), -n
(numeric ports) and -p (show the process listening).
Code:
ss -lnp
Pretty cool eh? Oh, if you didn't see the processes using the ports, you will need to be root, so
put a sudo in front of that last command.