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:
I've seen some versions of hostname that don't have the -i option, so this may not work everywhere. When available, it's a better alternative than using ifconfig and wasting eyeball muscle to search for the address, and it's definitely simpler than using awk/sed.
There are 7 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.