If you are using a server or desktop system, you should regularly check or confirm open or listening ports to prevent unwanted intrusions. This is a good security measure to protect your system or server from malicious people. On Ubuntu Linux systems, you can easily find all open ports in your terminal application without using any third party GUI tools. This article describes how to find or determine the listening port for your Ubuntu linux system.
List of all open ports on Ubuntu Linux
Open a terminal application and run the following command to see all open ports on your Ubuntu system.
Method 1: Use the netstat command
sudo netstat -ntlp | grep LISTEN
sudo netstat --tcp --listening --programs --numeric
sudo netstat -tulpn
If the netstat command does not work, install net-tools and try again.
sudo apt install net-tools
Method 2: Use the lsof command
sudo lsof -nP -i | grep LISTEN
Method 3: Use the ss command
References: Check total size of directory from Ubuntu command line
It’s a sequel.