Useful macOS terminal commands – How to find the device name being used by your network ports

As a general rule, if you are working from an Apple Macintosh laptop the device name of your WiFi adapter will be en0. However if you are working from an iMac or Mac mini computer, its network port will be en0, while the WiFi port will be en1.

While this detail is not all that important when using your computer. If you are troubleshooting a network or your Mac through Terminal commands, you will need to know the device name for specific network ports.

So in this video we take a look at a Terminal command that lists the details to all the hardware ports on your Apple Macintosh computer.

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.
 networksetup -listallhardwareports
  • When you press Enter on the keyboard you will be presented with a report listing the hardware ports on your computer. From this list you should be able to determine the device name for each of the ports being used.
  • It is through using a specific device name that you can make other terminal commands more useful.
  • 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)

Thank you for your support

Advertisement