+2 votes
in Operating Systems by (71.8k points)
I want to check the number of lines in a file. I know how to check in LINUX, but don't know how to check in Windows. Is there any Windows command to count the number of lines in a file?

1 Answer

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

Yes, there is findstr command in Windows which can give you the number of lines in a file. Open your command window, use CD command to go to the folder where your file is present and type the following command to find the number of lines in your file.

findstr /R /N "^" filename | find /C ":"    

Replace the text highlighted in blue with your filename.


...