-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
  • 36,095
  • 47
  • 151
  • 295

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,064
  • 6
  • 51
  • 88