What is the best way to extract the MAC address from ifconfig\'s output?
ifconfig
Sample output:
bash-3.00# ifconfig eth0 eth0 Link
For Ubuntu/Debian
ifconfig | grep HW | awk '{print $5}'
For Rhat or CentOs try
ip add | grep link/ether | awk '{print $2}'