Livejournal
Log in
Post
Friends
My journal
rickxu
获取 ip 的方法
Jul 20, 2006 00:35
ifconfig eth0 | grep inet[^6] | cut -d : -f 2 | cut -d " " -f 1
ifconfig eth0 | sed -n 's/.*inet addr:\([^ ]*\).*/\1/ p'
ifconfig eth0 | awk '/inet[^6]/ {print $2}' | awk -F ":" '{print $2}'
Leave a comment
Previous post
Next post
Up