Skip to content

Instantly share code, notes, and snippets.

@ylt6
Created March 5, 2017 06:00
Show Gist options
  • Save ylt6/05be64ee405390afc96491ca270ea347 to your computer and use it in GitHub Desktop.
Save ylt6/05be64ee405390afc96491ca270ea347 to your computer and use it in GitHub Desktop.
Print host IP on linux server
ifconfig eth0 | grep 'inet addr:' | awk -F'inet addr:' '{ print $2}' | awk '{ print $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment