Shell command for getting mac address in OS X

JVMX picture JVMX · Feb 23, 2015 · Viewed 36.1k times · Source

I have been handicapped by the GUI and always seem to ask of help when it comes to the command line.

On Mac OS X only I need a command line to get the mac address of the wifi currently in use.

Help!

Answer

beresfordt picture beresfordt · Feb 24, 2015

ifconfig en1 gets the interface details for wifi, the mac is on a line starting with ether, and is the second word on that line so:

ifconfig en1 | awk '/ether/{print $2}'