The oneliner below works as follows:
- First off, you must be on the same LAN subnet for this to work, otherwise getting the MAC is most likely impossible
- Ping the host to make sure the MAC is in the ARP table
- Get the MAC using arp and cut out surrounding noise
- Tested on Ubuntu 15.10 and CentOS 6
IP=188.8.131.52 ; ping $IP -c 1 > /dev/null ; arp -n | grep "$IP " | tr -s ' ' | cut -f3 -d' '