Page 1 of 1

Changing ether to hwaddr

Posted: 2019/04/27 08:03:58
by charan.guddu
Hi,
When I type ifconfig in CentOS 7 the output shows "ether" for the MAC address but I want it to show as "HWaddr" instead of "ether".
Kindly suggest me the way to modify the output of ifconfig command.

Regards,
Charan

Re: Changing ether to hwaddr

Posted: 2019/04/27 12:32:14
by tunk
ifconfig | sed 's\ether\HWaddr\g'

Re: Changing ether to hwaddr

Posted: 2019/04/27 13:21:37
by TrevorH
ifconfig has been deprecated for more than 10 years. Its replacement is the ip command, specifically ip link show or ip addr show.

Neither uses HWAddr.

Re: Changing ether to hwaddr

Posted: 2019/04/28 05:44:40
by charan.guddu
Yes I agree, but ifconfig is hardcoded in our application and in CentOS 6 the output shows HWaddr, we want the same to be shown in CentOS 7 also

Re: Changing ether to hwaddr

Posted: 2019/04/28 11:44:05
by TrevorH
Then the solution is the one involving sed that was already posted.