Skip to content

Instantly share code, notes, and snippets.

@aleksandarristic
Created August 5, 2015 14:22
Show Gist options
  • Save aleksandarristic/7595c1584fc9d4df601a to your computer and use it in GitHub Desktop.
Save aleksandarristic/7595c1584fc9d4df601a to your computer and use it in GitHub Desktop.
Get network info from bash
ip -o -f inet addr show $(ip route list | awk '/^default/ {print $5}') | awk '{print $4}'
@aleksandarristic
Copy link
Author

...using the default interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment