常用的查看文件行数的命令,cat,wc,sed,awk,grep
[root@test /]#cat -n /etc/init.d/functions |tail -1|awk '{print $1}'
777
[root@test /]# wc -l /etc/init.d/functions |cut -d" " -f 1
777
[root@test /]#sed -n '$=' /etc/init.d/functions
777
[root@test /]#awk '{print NR}' /etc/init.d/functions |tail -1
777
[root@test /]#grep -n $ /etc/init.d/functions |tail -1|cut -c 1-3
777
本文出自 “早起的鸟儿有虫吃” 博客,请务必保留此出处http://hejianping.blog.51cto.com/11279690/1750476