Can I view the source code of
netstat on my Linux machine?
Yes you can. Download it.
But as you don't say what flavor of linux re you using here is couple of examples:
# What package is the netstat executable in? apt-file search /usr/bin/netstat # Now download the source of that package apt-get source net-tools
yumdownloader --source net-tools
netstat is part of the
net-tools suite. The project home page is here:
You can browse the
netstat source here: http://sourceforge.net/p/net-tools/code/ci/master/tree/ or view the netstat.c file.
Probably you need this: http://www.tazenda.demon.co.uk/phil/net-tools/.
If you need more precise answer - use your local package manager to get info about package containing