sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:80 ## see a specific port such as 80 ##
sudo nmap -sTU -O IP-address-Here
On a Windows server, you can use the following command to find out all the ports being used by your applications on the server:
netstat -a -b