常用的查看文件行数的命令,cat,wc,sedawk,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