Use netstat to See Internet Connections
February 20th, 2009 by Erik Falor in
Using netstat, you can monitor programs that are making connections to remote hosts:
$ netstat -tpe
The -t flag limits the output to show only TCP connections. The -p flag displays the PID and name of the program making the connection. The -e flag displays extra information, such as the user name under which each program is running.
__________________________
Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer
Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.
Subscribe now!
The Latest
Newsletter
Tech Tip Videos
- Nov-19-09
- Nov-04-09
Recently Popular
From the Magazine
December 2009, #188
If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.
Delicious
Digg
StumbleUpon
Reddit
Facebook








Just as a reminder, using -n
On February 28th, 2009 m.roshany (not verified) says:
Just as a reminder, using -n option (for numeric) bypasses sometimes slow reverse DNS lookups. :)
serviced apartments liverpool
On February 27th, 2009 serviced apartments liverpool (not verified) says:
Netstat is the best tool for command line and to display network connections.
Netstat is the best tool for
On February 27th, 2009 Golf Club (not verified) says:
Netstat is the best tool for command line and to display network connections.
my .bashrc alias
On February 23rd, 2009 Anonymous (not verified) says:
my
.bashrc
alias n='netstat -p -a -A inet'
alias n6='netstat -p -a -A inet6'
alias nn='netstat -pn -a -A inet'
alias nn6='netstat -pn -a -A inet6'
Thanks ...
On February 21st, 2009 Anonymous (not verified) says:
Thanks ...
Post new comment