快速获取本机地址 ifconfig eth0 | grep "inet addr:" | awk '{print $2}'| cut -d: -f2 或 ifconfig |grep -v '127.0.0.1' | grep "inet addr:" | awk '{print $2}'| cut -c 6-
192.168.23.136
本文介绍了一种通过命令行快速获取本机IP地址的方法,适用于Linux系统环境。使用ifconfig命令结合grep、awk和cut工具,可以精确筛选并输出当前网络适配器的IP地址。
快速获取本机地址 ifconfig eth0 | grep "inet addr:" | awk '{print $2}'| cut -d: -f2 或 ifconfig |grep -v '127.0.0.1' | grep "inet addr:" | awk '{print $2}'| cut -c 6-
192.168.23.136
944

被折叠的 条评论
为什么被折叠?