Count rows in a file using Windows/Dos prompt

written by Admin


Posted on 2012-12-28


Problem

Under Windows I want to count all rows in a text file without installing any software (only using dos prompt).

Solution

Open a dos prompt and type:
findstr /R /N "^" <file> | find /C ":"

Feedback


Comments

Leave a Comment:

Search

Welcome

We need collaboration and a real boost from our community: write us an email for every trick you find!

This website is a sysadmin swiss-knife for every-day Windows, Linux and Mac administration and troubleshooting

Our database grows if YOU send us your tips and trick as soon as you find them every day!