Changing ether to hwaddr

Issues related to configuring your network
Post Reply
charan.guddu
Posts: 3
Joined: 2019/04/27 07:43:03

Changing ether to hwaddr

Post by charan.guddu » 2019/04/27 08:03:58

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

tunk
Posts: 611
Joined: 2017/02/22 15:08:17

Re: Changing ether to hwaddr

Post by tunk » 2019/04/27 12:32:14

ifconfig | sed 's\ether\HWaddr\g'

User avatar
TrevorH
Forum Moderator
Posts: 26981
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Changing ether to hwaddr

Post by TrevorH » 2019/04/27 13:21:37

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.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

charan.guddu
Posts: 3
Joined: 2019/04/27 07:43:03

Re: Changing ether to hwaddr

Post by charan.guddu » 2019/04/28 05:44:40

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

User avatar
TrevorH
Forum Moderator
Posts: 26981
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Changing ether to hwaddr

Post by TrevorH » 2019/04/28 11:44:05

Then the solution is the one involving sed that was already posted.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Networking Support”