How to get network adapter stats in linux/Mac OSX?

前端 未结 3 1347
别跟我提以往
别跟我提以往 2020-11-28 08:40

I\'m looking for a way to get hold of network stats in C on Linux and MacOSX. Specifically, I need to monitor the number of bytes uploaded and downloaded from each network a

3条回答
  •  难免孤独
    2020-11-28 08:49

    on Linux:

    • low level: check /sys/class/net/eth0/statistics/
    • slightly higher level: ip -s link show eth0
    • graphical: iftop
    • interactive: iptraf

提交回复
热议问题