[Shorewall-users] TCP/IP ports and Name of Service

Tom Eastep teastep@shorewall.net
Wed, 9 Jan 2002 10:37:36 -0800


On Wednesday 09 January 2002 10:33 am, Alok K. Dhir wrote:
> You could also just look through (or grep) "/etc/services" on your linu=
x
> box...

Nod -- I use the following little script which I place in /usr/bin/port:
-------------------------
#!/bin/sh

if [ ! $# -eq 1 ]; then
        echo "`basename $0` <port number>"
        exit 1
fi

grep "\b$1/" /etc/services
--------------------------
Example of use:

[teastep@ursa posixfs]$ port 445
microsoft-ds    445/tcp
microsoft-ds    445/udp
[teastep@ursa posixfs]$

-Tom
--=20
Tom Eastep    \ A Firewall for Linux 2.4.*
AIM: tmeastep  \ http://www.shorewall.net
ICQ: #60745924  \ teastep@shorewall.net
-------------------------------------------