Skip to content

Instantly share code, notes, and snippets.

@idleuncle
Last active May 6, 2019 15:10
Show Gist options
  • Save idleuncle/f0ec6ef8fc4961eceb3d7160df1bcebe to your computer and use it in GitHub Desktop.
Save idleuncle/f0ec6ef8fc4961eceb3d7160df1bcebe to your computer and use it in GitHub Desktop.
获得主机IP地址
ifconfig -a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | tr -d "addr:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment