
The following instructions will vary depending on which desktop environment you are using. To be able to do this, you will need the following piece of code:Ĭhange the permissions of getmac.sh file and execute the file by typing the following command: The below getmac.sh bash file can also be used to find the MAC address of any network adapter. In case, if you want to get the details of particular interface, then you can replace the * with your interface name:Ĭommand: cat /sys/class/net/ens33/addressĬommand: cat /sys/class/net/*/uevent /sys/class/net/*/address | grep -v IFINDEX | column | sed ‘s/INTERFACE=//’ 4.

If you just need to pull MAC addresses for a system and pair to an interface, you can easily get it done via below Bash command. Or in simple way, you can also use the following command:Ĭommand: ifconfig | grep ether | cut -d ” ” -f 10Ĭommand: ifconfig | grep “ether*” | tr -d ‘ ‘ | tr -d ‘\t’ | cut -c 6-22 With the help of some regular expressions, you can also find the MAC addressĬommand: ip a | grep ether | cut -d ” ” -f6Īlternatively, you can also try the below command:Ĭommand: ip link show ens33 | grep link/ether | awk ‘’ In below screenshot, we have highlighted our MAC address for the ens33 interface. Start by opening a terminal and using the following ip command to view information for all installed network interfaces. In this article, you will learn how to obtain the MAC address on a Ubuntu Linux system via many ways: Unlike IP addresses, which can change frequently and easily, MAC addresses are permanently tied to the hardware.

Every network interface has its own unique MAC address.
