-1

Googleing the subject line returns a lo of commands that tell the file size. Like:

ole@waddup:~/$ du -h package.json 
4.0K    package.json

How can we find the number of lines in the file. For example if package.json contains 55 lines, how do we see this very quickly running a command?

Ole
  • 41,793
  • 59
  • 191
  • 359

2 Answers2

3

Use the wc command line utility:

wc -l package.json

2

How can we find the number of lines in the file

wc -l <file>
Adam Siemion
  • 15,569
  • 7
  • 58
  • 92