Date: 2008apr15
Update: 2025sep2
OS: Linux
Q. Linux: What's an alternate way to see network activity?
A. Use lsof - which stands for List Open Files.
Sounds weird, huh? But on Linux/Unix everything is a file -- even
network connections!
Here are some exampel uses (run as root):
All TCP/IP connections:
lsof | grep -w TCP
All IPv6 connections:
lsof | grep -w IPv6
Or
lsof -i6
If you don't want any IPv6 running see my tip on disabling it:
http://www.davekb.com/search.php?target=disable+IPv6
What's Apache doing:
lsof | grep -w httpd
(Lists files it has open and network connections - nice)
lsof has many options. But I prefer simply grep-ing.
If you aren't root some files will be unavailable.