热爱开源,热爱linux
分类: LINUX
2010-12-28 19:07:02
ifconfig |grep "[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}"|grep "inet"|head -1 |awk -F":" '{print $2}'|awk '{print $1}' |
ifconfig |grep "inet"|grep -v "inet6"|grep -v "127.0.0.1"|awk -F":" '{print $2}'|awk '{print $1}' |
cat datafile |wc -l |
perl -ne 'print $. if eof' datafile |
awk 'END{print NR}' datafile |
nl data|tail -n1 |