Skip to content

Instantly share code, notes, and snippets.

@ameeno
Last active March 19, 2022 08:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ameeno/921fa76a11ef285fb6ae31c3178ad5ee to your computer and use it in GitHub Desktop.
Save ameeno/921fa76a11ef285fb6ae31c3178ad5ee to your computer and use it in GitHub Desktop.
check open ports linux
How to check if port is in use in
To check the listening ports and applications on Linux:
Open a terminal application i.e. shell prompt.
Run any one of the following command on Linux to see open ports:
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
For the latest version of Linux use the ss command. For example, ss -tulw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment