[CentOS] GRabbing MAC address

Jerry Geis

geisj at pagestation.com
Thu Feb 28 13:47:51 UTC 2008


I am trying to grab the mac address for eth0 on centos 5.1 with

ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything.

What am I not doing right?

ifconfig | grep eth0 | cut -d ' ' -f 1 gives me eth0 but anything else 
like -f 2, -f 3 etc
I get nothing.

Jerry




More information about the CentOS mailing list