ifconfig 命令
ifconfig 命令可以显示所有网络接口及其 IP 地址。
例如:
ifconfig
hostname -I 命令
hostname -I 命令显示当前主机的所有 IP 地址。
例如:
hostname -I
ip addr 命令
ip addr 命令提供有关网络接口和 IP 地址的更详细的信息。
例如:
ip addr
netstat 命令
netstat 命令可以显示网络连接和 IP 地址。
例如,要显示所有 TCP 连接及其 IP 地址,可以使用:
netstat -ant | grep ESTAB
ip route 命令
ip route 命令显示路由表和 IP 地址。
例如,要显示默认网关的 IP 地址,可以使用:
ip route | grep default
上一篇:linux 如何查看ip
下一篇:linux查看所有ip地址