Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 16
    I don't think this is actually a per-process counter; I think it's just the total interface count from the process' point of view. I ran a client/server nc pair over localhost, sending one byte per second, and watched /proc/<listening-nc-pid>/net/dev. Then I ran a second nc pair, sending at maximum rate. The file I was watching very obviously counted the second pair's data along with the first pair's. Running on Linux 2.6.32. Commented Feb 5, 2011 at 8:33
  • I had an error function strftime never defined; it was fixed by installing gawk. Commented Mar 3, 2011 at 11:12
  • 4
    @Jander That's correct, /proc/<pid>/net/dev and /proc/net/dev have the same content here. Hence the scipt only reports the traffic for eth0, not for the given process. Commented Aug 17, 2012 at 10:58
  • 3
    Confirming that this is not an answer. It measures the interface counter for eth0, as seen by the process. It does not count data sent by the process through that interface. Commented Jun 30, 2016 at 12:44
  • @Navin an answer is anything that tries to answer the question. A wrong answer is still an answer. If this one is wrong, then you may downvote it, but it's still an answer. Commented Jun 30, 2016 at 14:00