Skip to content

Commit

Permalink
'bhogs' wrapper which automatically adds connected network devices to…
Browse files Browse the repository at this point in the history
… 'nethogs' argments
  • Loading branch information
epitron committed Jul 20, 2015
1 parent 5cc293b commit a2fb592
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bhogs
@@ -0,0 +1,9 @@
#!/usr/bin/env ruby

devs = open("/proc/net/dev").each_line.map do |line|
if line =~ /^\s*([ewa][^:]+): /
$1
end
end.compact

system("sudoifnotroot", "nethogs", *devs)

0 comments on commit a2fb592

Please sign in to comment.