How can I find out my WiFi adapter's MAC address on Ubuntu Linux?
Solution 1
Combining the answer from @user562374 with a little scripting:
ip addr show $(awk 'NR==3{print $1}' /proc/net/wireless | tr -d :) | awk '/ether/{print $2}'
The wireless interface is shown in /proc/net/wireless
and that is used to extract the MAC address from the ip addr
output.
Solution 2
You will want to look at iwconfig
and ifconfig
for information about your ethernet controllers. iwconfig
is geared towards wireless.
Solution 3
For details about your wifi interface, use
iw dev
Or, if you just want the MAC address
iw dev | grep addr | awk '{print $2}'
Solution 4
From the arch wiki docs:
To find the MAC address that corresponds with a particular interface (ie wlan0), you can enter this command:
ip link show <interface-name>
The MAC address is the one that has "link/ether" followed by a 6-byte number. It will probably look something like this:
link/ether e8:b1:fc:9c:a6:8a brd ff:ff:ff:ff:ff:ff
Where the MAC address is e8:b1:fc:9c:a6:8a
*If you don't know your interface name, just enter ip link
to list the MAC addresses and interface names of all your interfaces. *
Solution 5
/sbin/ifconfig | grep HWaddr
You can add the interface name of your WiFi card (e.g. wlan0
) after ifconfig, but it's not necessary.
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on September 17, 2022Comments
-
Admin almost 2 years
What command can I enter in a terminal to find out the MAC address of my WiFi adapter?
-
Arcege over 13 yearsOn my Ubuntu 10.04 and 10.10 systems, the wifi interface is
eth1
. -
bitsmack over 3 yearsThis answer is current and correct as of 2021. The original question and most of the other answers are over a decade old!