Useful macOS network terminal commands – How to find your local IP address

In this video, we take a look at a terminal command that will display the local IP address that an Apple Macintosh computer is using. However please note that in order to use this command, you will need to know the device name for your computers network adapter.

Note: As a general rule, if you are working from a laptop the device name of your WiFi adapter will be en0. However if you are working from a desktop computer, the network port will be en0, while the WiFi port will be en1.

Quick reference notes:

  • From your macOS desktop, select Spotlight Search.
  • Within Spotlight Search type Terminal and press Enter on your keyboard
  • Now at the command prompt type.
 ipconfig getifaddr en0
  • When you press Enter on the keyboard you will be presented with the local IP address your computer is currently using to connect to your network.
  • To gracefully close your current Terminal session type:
exit
  • When you press Enter on your keyboard the Terminal session will end and you can close the Terminal application.

Reference Material:

Wikipedia article – Terminal (macOS)

Advertisement




You can also follow us on