#方法1
ip link show eth0 | awk '/ether/ {print $2}'
#方法2
ifconfig eth0 | awk '/HWaddr/ {print $5}'
#方法3
cat /sys/class/net/eth0/address
#方法4
ifconfig eth0 | grep HWaddr | cut -d ' ' -f 11
Linux通过shell命令获取当前机器mac地址
Previous post: Magento裁剪后的略缩图背景填充颜色的修改
Next post: 使用wget递归下载URL下的所有文件
Comments on this entry are closed.