LC_ALL=C ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' |cut -d: -f2 | awk '{ print $1}'#该片段来自于http://www.codesnippet.cn/detail/020520133101.html
来源: http://www.codesnippet.cn/detail/020520133101.html