Wednesday, September 21, 2022

Check and listen open active ports on Unix

sudo lsof -i -P -n | grep LISTEN // list open ports

sudo netstat -tulpn | grep LISTEN

sudo ss -tulpn | grep LISTEN

sudo lsof -i:22 // see a specific port such as 22 with PID USER FD TYPE DEVICE NODE NAME

sudo nmap -sTU -O IP-address-Here

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

sudo kill `sudo lsof -t -i:3000` // kill process on port 3000

https://stackoverflow.com/questions/9346211/how-to-kill-a-process-on-a-port-on-ubuntu

No comments:

Post a Comment