+2 votes
in Operating Systems by (12.4k points)
I have a very large file, so when I open it using nano/vi, my system just sleeps. Is there any way to count the number of lines in the file without opening it.

1 Answer

0 votes
by (22.2k points)

You can use "wc -l" to count to number of lines in a file.

Example:

$ wc -l covariates.txt

20783244 covariates.txt

...