Below is a handy little bash function that returns your local IP address on OSX (and maybe elsewhere). Just pop the following in your .profile
.
### Get local IP ###
function ip {
ipconfig getifaddr en1
}
Below is a handy little bash function that returns your local IP address on OSX (and maybe elsewhere). Just pop the following in your .profile
.
### Get local IP ###
function ip {
ipconfig getifaddr en1
}
The function, as written, failed to return the IP address of my MBP running OS X 10.9.1. After poking around a bit, I was able to modify the function to work. Also, rather than inserting the snippet into .profile, I added it to .bash_profile. This is working for me:
function ip {
ifconfig en0
}