Skip to content

Instantly share code, notes, and snippets.

@warrickcustomhomes
Created June 20, 2013 02:04
Show Gist options
  • Save warrickcustomhomes/5819790 to your computer and use it in GitHub Desktop.
Save warrickcustomhomes/5819790 to your computer and use it in GitHub Desktop.
Get default route on Ubuntu
# this works...
route -n | grep ^0.0.0.0 | tr -s ' ' | cut -d ' ' -f2
# and so does this...
ip route | grep ^default | cut -d ' ' -f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment