Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shell command for getting mac address in OS X

Tags:

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!

like image 481
JVMX Avatar asked Feb 23 '15 22:02

JVMX


People also ask

What is the command line for MAC address?

In the Command Prompt window, type ipconfig /all and press Enter. Under the Ethernet Adapter Local Area Connection section, look for the "Physical Address". This is your MAC Address.

What command shell does MAC use?

The shell is the command-line interpreter, or language, that will process the commands of the script. Historically, the default shell for macOS was bash. But with the introduction of macOS Catalina Apple changed the default to zsh (zshell).

How do I get just the MAC address in Linux?

Linux. Open a terminal and use the ifconfig command. The MAC address will be listed next to HWaddr.


1 Answers

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}' 
like image 97
beresfordt Avatar answered Sep 17 '22 12:09

beresfordt