Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phamngsinh/494b8af95ca449da8009e332f87ce101 to your computer and use it in GitHub Desktop.
Save phamngsinh/494b8af95ca449da8009e332f87ce101 to your computer and use it in GitHub Desktop.
How to check if port is in use on Linux or Unix
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment