OS X Tip: Get Current Airport IP

I got a bit of help from the denizens of IRC (crschmidt, kpried) in creating a little bit of shell code that, when run, will get the current IP address of en0 (on my Powerbook that’s the Airport) and 1) put it on the clipboard, and 2) print it out. This should go on one line in your .bash_profile.

alias ip='/sbin/ifconfig en1 inet | grep inet | sed -e "s/.inet (.) netmask.*/1/" | tr -ds "n" "" | tee /dev/tty | pbcopy; echo'

If you’re running tcsh, modify as necessary.

R.E.M. Says:

About this Entry

This page contains a single entry by Steve published on November 18, 2004 4:42 PM.

Evening tidbits was the previous entry in this blog.

U2 - How To Dismantle An Atomic Bomb Streams is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID