Skip to content

Instantly share code, notes, and snippets.

@ryran
Created July 11, 2013 13:52
Show Gist options
  • Save ryran/5975615 to your computer and use it in GitHub Desktop.
Save ryran/5975615 to your computer and use it in GitHub Desktop.
Another tiny bash function for quickly showing local system IP addrs.
#!/bin/bash
# Simply prints non-127 ip addresses
function myips {
echo "$(hostname) IP addrs:" >&2
ip a | awk '/inet / {if ($2 !~ /^127/) print " "$2}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment