Netstat OR SS command , What the heck is that, and how it helps us in getting Network Statitcs or fixing issues.
Linux has plethora of tools which are very helpful and gives lot of information. Recently i encounter an error, and i have to research connections created by my java program,Plus Which server it is connecting , how many connections it is creating , on which port it is connecting etc. So after some Google, i got two command for doing this job.
netstat and ss
What is netstat
Netstat is a command-line network utility used to display network connections for the TCP/UDP, network protocol statistics, interface statistics, routing tables, masquerade connections, multicast memberships e.t.c. netstat program is obsolete now and its replacement is ss.
A Simple run of netstat command on mac book, it will list all tcp/udp connections currently happening on my pc.
if you see above screen shots , it provide information of tcp/udp connections, connections state, how much data is getting received and send , from which address to which address.
This output further can be customized by netstat options. some of these are
- l, –listening display listening server sockets
-a, –all display all sockets (default: connected)
-r…