Use Nmap tool.
Typical types of port scanning:
A) TCP Connect scanning
nmap -v -sT localhost
nmap -v -sT 192.168.0.0/24
B) TCP SYN (half-open) scanning:
nmap -v -sS localhost
nmap -v -sS 192.168.0.0/24
C)TCP FIN scanning:
nmap -v -sF localhost
nmap -v -sF 192.168.0.0/24
D)TCP Xmas tree scanning
Useful to see if firewall protecting against this attack or not:
nmap -v -sX localhost
nmap -v -sX 192.168.0.0/24
F) TCP Null scanning
Useful to see if firewall protecting against this attack or not:
nmap -v -sN localhost
nmap -v -sN 192.168.0.0/24
G) TCP Windows scanning
nmap -v -sW localhost
nmap -v -sW 192.168.0.0/24
H) TCP RPC scanning
Useful to find out RPC (such as portmap) services
nmap -v -sR localhost
nmap -v -sR 192.168.0.0/24
I)UDP scanning
Useful to find out UDP ports
nmap -v -O localhost
nmap -v -O 192.168.0.0/24
J) Version scanning:
You can also find out what software version opening the port.
nmap -v -sV localhost
nmap -v -sV 192.168.0.0/24
