Re: GRabbing MAC address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



ip is probably a better tool (than ifconfig)

ip link show eth0 | tr -s " " | cut -d" " -f3

Max Hetrick wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Toby Bluhm wrote:

There's multiple spaces in the output that cut is hitting - use tr to
reduce them.

ifconfig | grep eth0 | tr -s ' ' ' ' | cut -d ' ' -f 5

Or:

ifconfig | grep eth0 | cut -d ' ' -f 11

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFHxr2hIXSX/6LmsXkRAuZcAJ9Yzxx2vuPhj8JEa1NIjrtXbpmEQQCfangU
eD8VSzg6fUrEN/jgPULWdEE=
=+Bez
-----END PGP SIGNATURE-----
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


--
Milton Calnek BSc, A/Slt(Ret.)
milton@xxxxxxxxxx
306-717-8737


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux