commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Require the moreutils package
There are 6 alternatives - vote for the best!
ifconfig is dead, long-live iproute2
this also uses only awk to do the grepping and removal of CIDR notation
Easy way to grab the IP address of a machine for easy script use. If needed a "| grep -v 127.0.0.1" at the end will suppress localhost.
If you can do better, submit your command here.
You must be signed in to comment.