How to check if port is in use in Linux

To check the listening ports and applications on Linux:

  1. Open a terminal application i.e. shell prompt.
  2. 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
  3. For the latest version of Linux use the ss command. For example, ss -tulw

https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *