Want to know what network services or applications are listening on your system?
How can I see a list of open ports on my Linux machine?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Want to know what network services or applications are listening on your system?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sarthak VarshneyRank #46 · 32K reputationPosted Jun 13, 2025, 1:12 AM EDT
If you want to check which ports are open and what services are listening on your Linux machine, there are a few simple commands you can use.
The one I use most often is:
sudo ss -tulnpThis shows all listening TCP and UDP ports along with the process names and PIDs.
t= TCPu= UDPl= listeningn= don’t resolve names (faster)p= show process infoAlternatively, you can also use:
sudo lsof -i -P -n | grep LISTENThis lists all listening ports along with the application that's using them. The
-Pkeeps port numbers in numeric form, and-navoids DNS lookups.If you prefer the other way and have
netstatinstalled:sudo netstat -tulnpAnd for a quick network scan of your own system (like from outside),
nmapis handy:sudo nmap -sT 127.0.0.1Just pick whichever tool you're most comfortable with. Personally,
sshas become my go-to since it’s faster and already available on most modern distros.