Linux 查看IP
UBuntu 系统下 按Ctrl+Alt+T 唤出终端
在终端输入: ifconfig 命令
点击回车 就可以看到自己电脑在局域网的IP地址了
图中第二行 inet 地址:192.168.1.101 就是你的电脑在局域网的IP地址了
如果输入 ifconfig 提示 找不到命令
那就在终端输入:sudo apt-get install net-tools 安装网络工具
安装完成后输入: sudo apt-get update 更新软件包
完成之后 再次输入 ifconfig 命令 就不会出现错误了
用Linux命令行获取本机外网IP地址
$ curl ifconfig.me
[root@localhost ~]# curl ifconfig.me
14.23.92.186
$ curl icanhazip.com
[root@localhost ~]# curl icanhazip.com
14.23.92.186
$ curl ident.me
[root@localhost ~]# curl ident.me
14.23.92.186
$ curl ipecho.net/plain
[root@localhost ~]# curl ipecho.net/plain
14.23.92.186
$ curl whatismyip.akamai.com
[root@localhost ~]# curl whatismyip.akamai.com
14.23.92.186
$ curl tnx.nl/ip
[root@localhost ~]# curl tnx.nl/ip
14.23.92.186
$ curl myip.dnsomatic.com
[root@localhost ~]# curl myip.dnsomatic.com
14.23.92.186
$ curl ip.appspot.com
[root@localhost ~]# curl ip.appspot.com
curl: (7) couldn't connect to host
$ curl -s checkip.dyndns.org | sed 's/.*IP Address: [0−9\.]∗[0−9\.]∗.*/\1/g'
[root@localhost ~]# curl -s checkip.dyndns.org | sed 's/.*IP Address: [0−9\.]∗[0−9\.]∗.*/\1/g'
14.23.92.186
本文来自博客园,作者:飞龙在生,转载请注明原文链接:https://www.cnblogs.com/flzs/p/10576264.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!