Linux获取网卡的公网ipv6地址

获取第一个网卡的ipv6地址 编辑

ip addr show | grep inet6 | grep 'scope global' | sed -n '1p'| sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d'