Windows
Linux
Networking
Windows getmac equivalent in Linux
Shows the hardware (MAC) address of each network interface card.
Windows
→
getmac
Linux equivalents
ip link show
ip link show
ip link show
Overview
What this command does
Shows the hardware (MAC) address of each network interface card.
Migration tip: MAC addresses appear in
ip link show on the line starting with link/ether. Each network interface has its own unique MAC address.Practical tasks
Common use cases
Display MAC addresses of network interfaces
Shows the hardware (MAC) address of each network interface card.
ip link show
Show all interfaces with MAC addresses
ip link show eth0
MAC address of specific interface
cat /sys/class/net/eth0/address
Direct MAC address from kernel
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
ip link show
cat /sys/class/net/eth0/address
Walkthrough
Examples with explanations
# Windows: getmac /v
ip link show
2: eth0: <BROADCAST,MULTICAST,UP>
link/ether aa:bb:cc:dd:ee:ff
# Just the MAC address:
cat /sys/class/net/eth0/address
aa:bb:cc:dd:ee:ff
Reference
Common options and variations
| Command or option | Use |
|---|---|
ip link show | Show all interfaces with MAC addresses |
ip link show eth0 | MAC address of specific interface |
cat /sys/class/net/eth0/address | Direct MAC address from kernel |
ip link | grep 'link/ether' | All MACs in one line each |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | ip link show |
Same command on this distribution. |
| Fedora | same command | ip link show |
Same command on this distribution. |
| Arch | same command | ip link show |
Same command on this distribution. |
Keep learning