/sbin/ifconfig -a | grep HWaddr | cut -d" " - f11
- ifconfig -a will list all the network interfaces, even the one that are down.
- grep will take all the lines containing HWaddr.
- cut -d" " -f11 will cut the line into fields separated by spaces and only print the 11th field.
An interesting point for this method is that it works in each run levels (even in run level 1).
No comments:
Post a Comment