Last updated 10 months ago
We can check if a port is in use or not, by following ways in Linux.
lsof
$ sudo lsof -i -P -n | grep LISTEN
Also, we can check a specific port by running -
$ sudo lsof -i:{PORT_NUMBER}
netstat
$ sudo netstat -tulpn | grep LISTEN
nmap
$ sudo nmap -sTU -O {IP_ADDRESS}
Source: