I need to show the ethernet interfaces on a Centos 7 server. On centos 6.5, I was using this command (from another post)and it works fine on 6.5.
ifconfig -a | sed -n 's/^\([^ ]\+\).*/\1/p' | grep -Fvx -e lo
on Centos 7 the interface output now has a trailing ":"
so my output look like this
ifconfig -a | sed -n 's/^\([^ ]\+\).*/\1/p' | grep -Fvx -e lo
ens32:
lo:
to remove the "lo:" I modified to this. which results in ens32:
ifconfig -a | sed -n 's/^\([^ ]\+\).*/\1/p' | grep -Fvx -e lo:
ens32:
How can I remove the trailing ":" ? can this sed be modified? or other ideas
ipon that system ?sed -rn '/^ |^lo/!s/ /\n/;/\n/P'==sed -rn 's/(^lo)? /\n/;/^[[:alnum:]]/P;'