+2 votes
in Operating Systems by (77.2k 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

+1 vote
by (354k points)
selected by
 
Best answer

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

Example:

$ wc -l covariates.txt

20783244 covariates.txt


...