Skip to content

Instantly share code, notes, and snippets.

@apinstein
Created February 12, 2011 22:49
Show Gist options
  • Save apinstein/824213 to your computer and use it in GitHub Desktop.
Save apinstein/824213 to your computer and use it in GitHub Desktop.
Want to see what processes are using your bandwidth? Don't have ntop?
#!/bin/sh
# Try this... kinda a hack but better than any other alternative I know of:
for i in `netstat -an | grep EST | awk '{ print $5; }' | sort | uniq | grep -v 127.0.0.1 | grep -v ::1 | sed -e 's/\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*/\1/'`; echo -n "Checking IP: $i => " && dig +short -x $i && echo -n " PROCESS: " && (lsof -i | grep $i) && echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment