Linux查看公有(运营商)IP地址:下面两个命令都可以查
curl http://ifconfig.io curl ident.me

Linux查看私有IP地址:可以使用以下四个命令中的任一一个
ip addr hostname -I | awk '{print $1}' ip route get 1.2.3.4 | awk '{print $7}' nmcli -p device show

使用命名nmcli -p device show可以查看设备详细信息

欢迎补充!
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/231977.html原文链接:https://javaforall.net
