Tag Info

New answers tagged

0

I believe netstat -ntp will only show client (nonlistening) sockets in the Local address column. The -l flag should cause netstat to list server (listening) sockets only, and with -a you should get both and then you can differentiate based on STATEs.


1

If you run the netstat without the grep, you'll see that the column to the left of the center has a heading like "Local Address" and the column to the right of the center has a heading like "Foreign Address".  The row that shows the local address that includes the server port number is the server. You may be able to get a better feel for this if you start ...


2

Hint: (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Try running netstat using sudo, i.e. sudo netstat ...


1

you like | do you ? the best I come with current_ip=$(ifconfig eth0 | awk '$1 == "inet" { split($2,A,":") ; print A[2] ; } ') netstat -plant | grep $current_ip | awk '{split($5,A,":") ; howmany[A[1]]++ ; } END { for (h in howmany) printf "%d %s \n",howmany[h],h ;} '| sort -nr | while read hm ho do name=$(host $ho|awk '{print $NF}') echo $hm $ho ...


1

I guess you mean Solaris 11.2 as Solaris 12 is not yet released, possibly next year (2016) according to a roadmap. /usr/bin/kstat is a Perl script in Solaris 11.2 so while still proprietary code, you can certainly read its source code. An alternative, C based open source version of the kstat command is available here ...



Top 50 recent answers are included