nmapコマンドを利用すると開いているポートを簡単に確認することができます。
CentOSとUbuntuで動作確認をしました。
以下の方法でインストールしてください。
yum install nmap
sudo apt-get install nmap
以下のコマンドで自機の開いているポートを調べることができます。
nmap localhost
$ nmap localhost Starting Nmap 5.00 ( http://nmap.org ) at 2012-03-27 23:56 JST Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1. Interesting ports on localhost (127.0.0.1): Not shown: 999 closed ports PORT STATE SERVICE 631/tcp open ipp Nmap done: 1 IP address (1 host up) scanned in 0.69 seconds
nmap ホスト名またはIPアドレス
$ nmap localhost Starting Nmap 5.00 ( http://nmap.org ) at 2012-03-27 23:56 JST Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1. Interesting ports on localhost (127.0.0.1): Not shown: 999 closed ports PORT STATE SERVICE 631/tcp open ipp Nmap done: 1 IP address (1 host up) scanned in 0.69 seconds