This is a user contributed quick tip.
How do you list the network open ports on your server and the process that owns them? The answer is simple use the following command (must run as root):
sudo lsof -i
sudo netstat -lptu
This article / faq / short tip is contributed by Vikrant Joshi. nixCraft welcomes readers' tips / howtos.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- 10 Greatest Open Source Software Of 2009
- My 10 UNIX Command Line Mistakes
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!
- Email this to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: May/30/2008



{ 3 comments… read them below or add one }
Shameless plug to a really good article I wrote about lsof and some of the more nifty tricks:
Troubleshooting running systems with lsof
Thanks Vikrant for the useful tip…I’ve used lsof for ages but sort of taken it for granted,didn’t check the man pages, and wasn’t aware of this option.
Great (!!!) site, by the way, I’ll start contributing my own tips as well. Thanks for giving me lots of ideas-projects to increase my understanding of Linux/BSD.
Thanks