This is the most reliable method because is actually scans the ports:
nmap -sT -O localhost
Other methods based on internal checks that give you also the information about the program using the ports:
netstat -anp lsof -i
This is the most reliable method because is actually scans the ports:
nmap -sT -O localhost
Other methods based on internal checks that give you also the information about the program using the ports:
netstat -anp lsof -i