Skip to content

Instantly share code, notes, and snippets.

@doomzhou
Created August 2, 2018 13:24
Show Gist options
  • Save doomzhou/d6275b6c441fe9c0c932c4831db26357 to your computer and use it in GitHub Desktop.
Save doomzhou/d6275b6c441fe9c0c932c4831db26357 to your computer and use it in GitHub Desktop.
osx没有iproute2, 虽然可以使用iproute2mac , 不过python3不行吧.
ip () {
ifconfig | awk '{if ($1 ~ /^[a-z]*[0-9]:/) { s=$1}; if ( $2 ~ /[0-9]*\./) {print s $2}}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment