Skip to content

Instantly share code, notes, and snippets.

@richbodo
Last active September 23, 2015 01:02
Show Gist options
  • Save richbodo/8f4204d10a7bc2ae6262 to your computer and use it in GitHub Desktop.
Save richbodo/8f4204d10a7bc2ae6262 to your computer and use it in GitHub Desktop.
Simple command line report of network status for mac OSX
#!/bin/sh
echo "******************"
echo "* En0 IP, Gateway, and Nameservers"
echo "******************"
echo
ifconfig en0 | grep -v inet6 | head -n 3
netstat -nr | head -n 5
scutil --dns | grep -i nameserver
echo
echo "******************"
echo "* Lsof tcp listeners (sudo or ctrl-c): "
echo "******************"
echo
sudo lsof -iTCP -sTCP:LISTEN -P -n
echo
echo "******************"
echo "* Network stuff in syslog: "
echo "******************"
echo
grep -i -E 'network|en0' /var/log/system.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment