Skip to content

Instantly share code, notes, and snippets.

@ttlequals0
Created December 6, 2015 21:27
Show Gist options
  • Save ttlequals0/a26d5fe734a249175a1a to your computer and use it in GitHub Desktop.
Save ttlequals0/a26d5fe734a249175a1a to your computer and use it in GitHub Desktop.
ip addr |grep inet |grep 192 |awk {'print $2'} |sed 's/\/23//'
ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment