您的位置:首页 > 运维架构 > Linux

Linux -- 统计文件的行数

2015-10-23 11:57 766 查看
统计单个文件有多少行

方法1:  awk '{print NR}' test1.sh|tail -n1

方法2:  awk 'END{print NR}' test1.sh

方法3:  grep -n "" test1.sh|awk -F: '{print '}|tail -n1

方法4:  sed -n '$=' test1.sh

方法5:  wc -l test1.sh

方法6:  cat test1.sh |wc -l
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: