wc

wc命令返回某个文件的行数、词数和字符数。

  1. $ wc demo.txt
  2. 7459 15915 398400 demo.txt

上面代码中,7459是行数,15915是词数,398400是字符数。