Retrieve IP address automatically
ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1;}'
You can add this to any command line requiring your IP address by using back ticks.
`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1;}'`
Written by Joel Grenon
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#