2
It’s been a few days since I’ve been searching the Internet for such an answer, but I haven’t had one so far. I am trying to print Ipv6 Global from ifconfig to be used in MOTD on Ubuntu.
With Ipv4 it was very easy to do this process with this command, because there is only one Ipv4 in inet.
root@gamerno:/home/stalker# ifconfig | grep 'inet' -m1 | awk {'print $2'}
192.168.254.254
For inet6 there are 3 Ipv6: local link, global link and loopback.
root@gamerno:/home/stalker# ifconfig | grep 'inet6' | awk {'print $2'}
fe80::222:4dff:feae:31fb < link local
b00b:cafe:face:628b::dead:beef < link global
::1 < loopback
Remembering that the Global link is in the second line.
Thanks for the return, but a friend gave me a light. Talking so much about Global that I ended up using it to get what I wanted. ifconfig | grep 'global' | awk {'print $2'}
– Kapiroto