Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have CentOS 5.5
I want to list all availible physical (or virtual on DomU) NICs connected to motherboard and see it's MAC addresses.
I guess that related information should be somewhere in /proc or may be in output of some command.
The option to list ifcfg-ethX files clearly not suitable here.

Thank you for ahead.

share|improve this question
up vote 5 down vote accepted


share|improve this answer
Thank you very much. And here is oneliner for match interface with MAC address. You are welcome to make it shorter: ls -d /sys/class/net/* | while read line; do echo -en "echo $line | cut -d'/' -f 5\t:"; echo -e "\tcat $line/address"; done – Rodnower Aug 23 '10 at 10:47
for i in /sys/class/net/* ; do echo -en "${i##*/}:\t" ; cat "$i"/address ; done – Ignacio Vazquez-Abrams Aug 23 '10 at 15:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .