Skip to content

Instantly share code, notes, and snippets.

@daz
Created May 23, 2014 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daz/10010044378bf49224d5 to your computer and use it in GitHub Desktop.
Save daz/10010044378bf49224d5 to your computer and use it in GitHub Desktop.
grep and awk to get the local network IP from ifconfig
ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment