Fri 9 Dec 2005
This chunk of code will show you a nice list of ports on which you have something listening.
#!/bin/sh
# listen - parse netstat -an output for listeners
netstat -an | awk '
BEGIN {
printf("%12s\t%5s\t%5s\n", "ADDRESS", "PROT", "PORT#")
printf("%12s\t%5s\t%5s\n", "-------", "----", "-----")
}
/ LISTEN / {
split($4,ip,":")
printf("%12s\t%5s\t%5s\n", ip[1], $1, ip[2])
}
'
March 31st, 2006 at 2:04 am
[...] List active internet connections ( just servers ) # netstat -l ( without servers ) # netstat -tup or try the useful script noted here [...]