#13 Use /sys/class/net/ rather than default to eth0

closed
nobody
None
5
2016-01-01
2013-04-17
maandree
No

You can list all existing network interfaces, including loopback (lo), by
listing all directories in /sys/class/net/, I suggest using those as default
rather than eth0, that way you do not need to type, for example, enp2s0f0 if
you have enp2s0f0 instead of eth0.

Discussion

  • Arnout Engelen

    Arnout Engelen - 2016-01-01

    Hi maandree,

    The lastest version of nethogs is smarter about automatically selecting the interface to monitor: instead of taking it from /sys, it'll look for non-loopback interfaces that are up and running. See https://github.com/raboof/nethogs/blob/master/devices.cpp#L31 for details.

    If you'd like to further improve this, please add a github issue. Thanks!

    Arnout

     
  • Arnout Engelen

    Arnout Engelen - 2016-01-01
    • status: open --> closed
    • Group: --> Next Release (example)