且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在shell中获取当前机器的ip地址

更新时间:2022-08-16 12:37:23

shell中获取得到当前机器的ip地址

ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'

原文:

http://www.blogjava.net/lihao336/archive/2010/04/03/317388.html