Terminal 101: Find your IP Address

Every Monday, we'll show you how to do something new and simple with Apple's built-in command line application. You don't need any fancy software, or a knowledge of coding to do any of these. All you need is a keyboard to type 'em out!

If you spend any time working in the command line, particularly using SSH to log into remote computers, then you may be wondering how you can easily find the IP address of the current machine you're on. While you certainly could just look up the IP address in the System Preferences Network pane, looking this information up in the Terminal looks cooler and is quite a bit faster. Continue reading and we'll show you how it's done.

To look up your IP address, simply type the following command into the command line in your Terminal application (located in /Applications/Utilities):

ipconfig getifaddr en0

If you are using Ethernet, or on a Mac without wired networking built in, then you will see your IP address; if you are running a Mac that has both wired and wireless connections, then you will need to substitute "en0" with "en1". This will tell the ipconfig command to only get the IP address associated with the interface "en1".

If you are running a late-2013 MacPro, or another type of Mac that has multiple interfaces, then you may need to use the following command to view a list of all of your interfaces, then specify the in-use interface in the command above.


Running the ipconfig command, the program will output a list of all the connected interfaces, and let you see which one is currently being used for your LAN connection. The one listed with an "inet" address that is not "" is usually the interface that you're connected through.

Cory Bohon is a freelance technology writer, indie Mac and iOS developer, and amateur photographer. Follow this article's author on Twitter.