Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

List open TCP ports in linux

by ash (Monk)
on Jan 10, 2001 at 00:22 UTC ( #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 cooling their heels in the Monastery: (4)
As of 2023-12-10 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?