본문 바로가기

Computer/linux

How to get only the mac address (Linux)

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}'

태그