Tag Archives: sed

Get ip the geek way

If typing ifconfig is too simple for you here it is the geeky way to get the ip of your interfaces.

 bash | 
 
 copy code |
?

1
ifconfig | sed -n "/en0//netmask/ p" | grep "inet " | awk '{print$2}' copy to .bash_profile: 
2
alias getip='ifconfig | sed -n "/en0//netmask/ p" | grep "inet " | awk ''{print\}'''