Equivalent of /proc/net/dev

Dinko

Registered
Hello,

I was wondering if there was an equivalent on MacOS X to the /proc/net/dev on Linux. What I want to do is be able to count the number of bytes entering and leaving the system. This seems possible since the Network Utility gives you those numbers. I would like to access them through the terminal, is that possible ?

Thank you,

Romain
 
are you looking for realtime display? If the need isn't too high, how about using netstat?
__nether
 
OK, so how would that work exactly. How to get the packets received/transmited for eg ?

Thank you,

Romain
 
Like I said, depends on what you want to do ... take a look at netstat -s. This gives stats per protocol.

Do a man netstat for a full explanaition. It may not be what you are looking for. Something else you might want to use is snort and run the logs through a perl counter.

__nether
 
Another way is to use "expect". It has the ability to grab a specific piece of text output from a pipe. So even though netstat was never designed to give you the feedback that you need, expect can be used to zero in on that snippet of text and yank it out for you.

bob..
 
Try netstat -w1

You'll see the packets updated every second.

BTW, /proc is an exclusive feature of Linux. None of the BSD's have it. Solaris has /devices which I think is similar (and different than /dev). but proc is a linux thingy.
 
Back
Top