Get the MAC Address from the Command Line

Windows CMD

getmac /v
ipconfig /all

PowerShell

Get-NetAdapter | Select-Object Name, MacAddress, Status

Linux (ifconfig is deprecated and needs the old net-tools package)

ip link show
cat /sys/class/net/eth0/address

macOS

ifconfig en0 | grep ether

Written by Daniel Ruiz Peláez, Systems & Infrastructure Engineer (Linux, VMware, Proxmox, Active Directory, networking and security). These are notes from real problems I have solved.

← Back to all posts