in reply to List open TCP ports in linux
#!/usr/bin/perl #< ....o.... ask@unixmonks.net ....o.... ># @ARGV=q(/proc/net/tcp);while(<>){s/(^\s*|\s *$)//sx;next if/^$/ or /sl/;split/\s+|:/x; $h{hex$_[3]}=$_[12]}for(sort{$a<=>$b}keys%h ){print"$_\t@{[[getpwuid($h{$_})]->[0]]}\n"}
|
|---|