What is the best way to extract the MAC address from ifconfig\'s output?
ifconfig
Sample output:
bash-3.00# ifconfig eth0 eth0 Link
this worked for me
ifconfig eth0 | grep -o -E ..:..:..:..:..:..
instead of eth0 you can write the interface you need it's mac address
eth0