Method 1: Using netstat
sudo netstat -tulpnMethod 2: Using ss (Modern)
sudo ss -tulpnMethod 3: Using lsof
sudo lsof -i -P -n | grep LISTENMethod 4: Using nmap (External Scan)
nmap -p- localhostContinuous Monitoring with watch
watch -n 5 'ss -tulpn'