Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

List open TCP ports in linux

by ash (Monk)
on Jan 10, 2001 at 00:22 UTC ( [id://50762]=obfuscated: print w/replies, xml ) Need Help??

#!/usr/bin/perl #< ....o.... ask@unixmonks.net ....o.... ># open(PRTCP,'/proc/net/tcp');while(<PRTCP>){ chomp;next if/^\s*$/;s/^\s*//;s/\s*$//;next if/^sl/;split/\s+/;@p=split':',$_[1];$h{hex $p[1]}=$_[7];}foreach(sort{$a<=>$b}keys%h){ print$_,"\t",[getpwuid($h{$_})]->[0],"\n"};
--- Ash <ask@NOSPAM.trancescape.org>
'Music is diffrent here, the vibration is different, not like planet Earth.'

Replies are listed 'Best First'.
--
by BooK (Curate) on Jan 11, 2001 at 02:36 UTC
    Well, this is all nice and useful, but where is the obfuscation?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://50762]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found