BASH 43
Linux / Ubuntu show ports in use By micha on 3rd June 2024 03:43:09 PM
  1. # How to check if port is in use in
  2. - Run any one of the following command on Linux to see open ports:
  3.  
  4. sudo netstat -tulpn | grep LISTEN
  5.  
  6. -t - Show TCP ports.
  7. -u - Show UDP ports.
  8. -n - Show numerical addresses instead of resolving hosts.
  9. -l - Show only listening ports.
  10. -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.
  11.  
  12. or
  13.  
  14. sudo lsof -i -P -n | grep LISTEN
  15. sudo ss -tulpn | grep LISTEN
  16. sudo lsof -i:22 ## see a specific port such as 22 ##
  17. sudo nmap -sTU -O IP-address-Here

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.