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

0 votes
by (3.7k points)

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.

...