- # How to check if port is in use in
- - Run any one of the following command on Linux to see open ports:
- sudo netstat -tulpn | grep LISTEN
- -t - Show TCP ports.
- -u - Show UDP ports.
- -n - Show numerical addresses instead of resolving hosts.
- -l - Show only listening ports.
- -p - Show the PID and name of the listener’s process. This information is shown only if you run the command as root or sudo user.
- or
- sudo lsof -i -P -n | grep LISTEN
- sudo ss -tulpn | grep LISTEN
- sudo lsof -i:22 ## see a specific port such as 22 ##
- sudo nmap -sTU -O IP-address-Here
Recent Pastes