Linux -- 统计文件的行数

统计单个文件有多少行

方法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
KEEP LEARNING!
原文地址:https://www.cnblogs.com/roronoa-sqd/p/4904068.html