How to Find MAC Address on Linux
If you need to find MAC address numbers for any network interface attached to your computer, then Linux makes this quite easy. Each computer network interface receives a unique Media Access Control (MAC) address, which explains what device it belongs to. No two MAC addresses are alike. Users with multiple networking interfaces will end up with more than one address to take a look at.
You’ll need to be working on a command line interface to find MAC address information, but you won’t need to be logged in as root. Graphical desktop environment users can usually hold down Ctrl+Alt+T to open up a terminal. Ubuntu Unity users can search for the word terminal on the Dash. Those using Xfce4 can find it on the Whisker Menu in System Tools, and LXDE, KDE and GNOME Shell users should find it on the menu in the same place. You can work from whatever prompt you’re given.
Method 1: Find MAC Address Numbers with ip link
At the prompt, simply type ip link and push enter. You’ll be given a list of MAC address figures and you simply need to look for the name that GNU/Linux gives to your network adapter. For instance, you might see wls1:, which probably indicates a Wi-Fi connection that you’re working with. A reference to link/ether would point to your Ethernet connection. You’ll quite possibly see more than one of these references if you’re on a beefier modern desktop computer or a laptop that you’ve personally upgraded.
You’ll also find link/loopback more than likely, which will consist of all zeros. This just points back to your own host. For security reasons, our screenshots were taken in a virtual machine, so we only had this adapter. You don’t want to share your MAC address with people!
There really isn’t anything to do, though. This one single command is enough to find the answer to your question without any further playing around.
Method 2: Find MAC Address with the ifconfig Command
Like with almost everything on the Linux command line, there is more than one way to find MAC address data. At the prompt, type ifconfig -a | grep HWaddr and then push enter. If this command is long and you’d like to copy it from this article, then remember that you’ll need to paste from the Edit menu in your terminal window. You might instead want to hold down Shift+Ctrl+V, but the normal Ctrl+V keyboard shortcut won’t work.
Once again, you won’t have to be root to run this command. As soon as you’ve run it, you’ll receive the MAC hardware address for each networking device attached to the system. You might have only a few on a laptop, while connected routers could ultimately list dozens of different connections if they’re sending packets in many different places.
There’s nothing else to do; you can find MAC address data with a single command. If you don’t see anything returned, then you’re probably not connected to a network. You’ll want to check to make sure that you didn’t disable networking, loose a Wi-Fi connection by moving around or unplug an Ethernet cord. You’ll probably also want to make sure you didn’t run the command in an unconnected virtual machine without a network like we did for the purposes of demonstration.