Created
December 31, 2013 21:05
-
-
Save purpleidea/8202237 to your computer and use it in GitHub Desktop.
for your .bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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