Network ports in Linux

# netstat -tuapen | grep “LISTEN”
Shows all open ports.
# /bin/ps -axf ;Shows all process threads
# cat /etc/services ; Shows all running services
# lsof ;Finds out all open files/process
# grep rpc.statd /etc/init.d/* ; Lists all services being started
# cat /proc/pid/exe ;Lists commands that start procs

You can check the commands that started the process after taking the pid from the netstat command.

# nmap localhost for seeing open ports
# nmap -sT -sU -p 1-65535 localhost               ;Scans ports