Skip to content

Instantly share code, notes, and snippets.

@purpleidea
Created December 31, 2013 21:05
Show Gist options
  • Save purpleidea/8202237 to your computer and use it in GitHub Desktop.
Save purpleidea/8202237 to your computer and use it in GitHub Desktop.
for your .bashrc
# run nethogs on the interface that is being used for the default route
function nethogs {
dev=`ip r | grep '^default' | awk '{print $5}'`
#echo $dev
if [ `id -u` -eq 0 ]; then
nethogs $@ $dev
else
sudo nethogs $@ $dev
fi
return $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment