Computer/linux

How to get only the mac address (Linux)

citadel 2017. 8. 25. 17:24

Sometime, I would like to get only the mac address of the ethernet device. so here is the command line to do this.



ip addr show dev enp5s0 | grep "link/ether" | awk '{print $2}'