When I run netstat -n
on Solaris I get different results from netstat -n
on Linux,
even though according to the manual pages in Solaris and Linux the -n
flag should do the same thing.
My question:
Please advise me how to run netstat
in Linux so that I will get the same results as I get in Solaris.
EXAMPLE:
Solaris
netstat -n | head-10
TCP:IPv4
LocalAddress RemoteAddress SwindSend-QRwindRecv-Q State
-------------------------------------------------------------------------
10.119.99.77.9495 10.106.97.118.60823 5888 049640 0CLOSE_WAIT
10.119.99.77.33121 10.119.99.77.1521 49152 049152 0ESTABLISHED
10.119.99.77.1521 10.119.99.77.33121 49152 049152 0ESTABLISHED
10.119.99.77.1521 10.119.99.112.54374 63702 049232 0ESTABLISHED
127.0.0.1.45459 127.0.0.1.8886 49152 049152 0ESTABLISHED
10.119.99.77.7777 10.115.244.53.63575 5888 049220 0CLOSE_WAIT
Linux
netstat -n | head -10
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:14407 127.0.0.1:20281 ESTABLISHED
tcp 0 0 10.106.207.143:61623 10.106.207.143:1521 ESTABLISHED
tcp 0 0 10.106.207.143:61630 10.106.207.143:1521 ESTABLISHED
tcp 0 0 10.106.207.143:61624 10.106.207.143:1521 ESTABLISHED
tcp 0 0 10.106.207.143:61625 10.106.207.143:1521 ESTABLISHED
tcp 0 0 10.106.207.143:61627 10.106.207.143:1521 ESTABLISHED
tcp 0 0 10.106.207.143:1521 10.106.207.143:32263 ESTABLISHED
tcp 0 0 127.0.0.1:20281 127.0.0.1:14407 ESTABLISHED
Linux's netstat is from GNU's net tools, Solaris's isn't (Windows has its own too, so do the BSD's). You can install GNU on Solaris if you want GNU behavior.
Linux
netstat
comes from net-tools which is not part of the GNU tools although licensed under the GPL.Solaris
netstat
originally comes from SVR4 netstat.Like most administrative commands,
netstat
is not standardized by POSIX so there is a large variation between the various implementations supported options and their output.net-tools
netstat
is then Linux specific so there is no way to install it on Solaris.