What is the best way to extract the MAC address from ifconfig\'s output?
ifconfig
Sample output:
bash-3.00# ifconfig eth0 eth0 Link
Use:
ifconfig eth0 | grep HWaddr
or
ifconfig eth0 |grep HWaddr
This will pull just the MAC address and nothing else.
You can change your MAC address to whatever you want:
ifconfig eth0 down, ifconfig eth0 hw ether (new MAC address), ifconfig eth0 up