Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What command can I enter in a terminal to find out the MAC address of my WiFi adapter?

share|improve this question

migrated from stackoverflow.com Jan 30 '11 at 20:58

This question came from our site for professional and enthusiast programmers.

4 Answers 4

The command

ip addr

will tell. ifconfig is a tool obsolete since 2001.

share|improve this answer
    
In fact quite before that. I remember that we switched our self-made carrier-grade Linux (for ISPs) completely over to iproute2 back in summer of 1999; and before that we had already used it for a couple of months. In 1999, ifconfig was already quite faulty with regard to VPN device setups (secondary IP addresses with aliases), like CIPE for example and exhibited massive race conditions if you had to reconfigure a box with hundreds of running VPN tunnels. Our boxes had up to 16 NICs (quad boards) and route had a problem sometimes displaying our hundreds of routing table entries. –  Moreaki Aug 30 '13 at 19:43

You will want to look at iwconfig and ifconfig for information about your ethernet controllers. iwconfig is geared towards wireless.

share|improve this answer
/sbin/ifconfig | grep HWaddr

You can add the interface name of your WiFi card (e.g. wlan0) after ifconfig, but it's not necessary.

share|improve this answer
    
On my Ubuntu 10.04 and 10.10 systems, the wifi interface is eth1. –  Arcege Jan 30 '11 at 21:33

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.