Nmap

From Linuxintro

nmap allows you to find out what network ports are open on your system:

itchy:~ # nmap localhost

Starting Nmap 4.75 ( http://nmap.org ) at 2009-04-06 23:38 EDT
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.
Interesting ports on localhost (127.0.0.1):
Not shown: 996 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
25/tcp  open  smtp
111/tcp open  rpcbind
631/tcp open  ipp

Nmap done: 1 IP address (1 host up) scanned in 0.28 seconds

Scan all ports

nmap -sS -O -PI -PT 192.168.0.0/24

To scan all ports -p 1-65535

See also