how to see ports in use on linux?

In this article let’s discuss about how to see ports in use on linux?. Let’s go through the following methods without any delay.

Method 1:

# Any of the following
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:22 # see a specific port such as 22
sudo nmap -sTU -O IP-address-Here

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar but have a try!

Method 2 :

sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:22 # see a specific port such as 22
sudo nmap -sTU -O IP-address-Here

Hope the above solution works.

Realted Posts : Error: refusing to merge unrelated histories