Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
LocalAddress       RemoteAddress   SwindSend-QRwindRecv-Q   State
 -------------------------------------------------------------------------
 10.119.99.77.9495   10.106.97.118.60823  5888     049640     0CLOSE_WAIT
 10.119.99.77.33121  10.119.99.77.1521   49152     049152     0ESTABLISHED
 10.119.99.77.1521   10.119.99.77.33121  49152     049152     0ESTABLISHED
 10.119.99.77.1521   10.119.99.112.54374 63702     049232     0ESTABLISHED
 127.0.0.1.45459     127.0.0.1.8886      49152     049152     0ESTABLISHED
 10.119.99.77.7777   10.115.244.53.63575  5888     049220     0CLOSE_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
share|improve this question
1  
When I run netstat -n on the two systems, the -n flag behaves in the same way, although the two programs format their outputs a little differently. Can you explain a little about how you want the Linux output to look and why you want it that way? –  asciiphil Dec 26 '13 at 14:51
    
please see my update question –  Eytan Dec 26 '13 at 17:13
    
Pasting isn't the same as explaining. We see your 2 examples, now what's the goal? You need the Rwind/Swind information? Just reorder the columns? Or for some unholy reason you need byte-for-byte mimicry? –  Wumpus Q. Wumbley Dec 26 '13 at 20:46
    
@Eytan Why aren't you explaining what precisely you expect and why, as already asked by Wumpus ? You accepted an answer that suggests a undoable solution. –  jlliagre Dec 31 '13 at 8:08

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.