有时可能文件实在是太大了、迩只是想简单的知道一下行数、可以使用下列的命令

cat xxx.txt | wc -l

不过一般这种情况比较少见、更常见的是迩想统计迩想知道单词的行数、比如

cat xxx.txt | grep error | wc -l

这样通过grep就能筛选出日志文件中包含error的行数了

 

 

文章参考链接:

http://blog.csdn.net/vah101/article/details/6335040

http://blog.chenlb.com/2008/12/linux-statistics-file-command-and-statistics-row.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2021-11-11
  • 2021-11-11
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2022-12-23
  • 2021-11-11
  • 2021-07-13
  • 2021-07-07
  • 2022-01-08
  • 2022-01-29
相关资源
相似解决方案