统计文件的行数
wc命令
cat nowcoder.txt | wc -l
wc -l < nowcoder.txt
wc -l nowcoder.txt | gawk '{print $1}'grep命令
grep -n "" nowcoder.txt | tail -n1 | gawk -F: '{print $1}'sed命令
sed -n '$=' nowcoder.txt
gawk命令
gawk '{print NR}' nowcoder.txt | tail -n1
gawk 'END{print NR}' nowcoder.txt
京公网安备 11010502036488号