Linux List The Open Ports And The Process That Owns Them

by Vivek Gite · 3 comments

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:

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!

{ 3 comments… read them below or add one }

1 Jeff Schroeder 05.30.08 at 12:50 pm

Shameless plug to a really good article I wrote about lsof and some of the more nifty tricks:

Troubleshooting running systems with lsof

2 Mark Nixon 05.30.08 at 6:42 pm

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.

3 harsha gowda 07.10.08 at 11:36 am

Thanks

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: