Click here to Skip to main content
15,891,976 members

find the number of blank lines in a file

Revision 2
Hi,


I need to find the number of blank lines from a particular directory in all the files that ends with '.h' extension.


Thanks in advance

OP's additional information copied from comment below
First dislayed all the .h files using the command ls /usr/include/ | grep '.h$'.

Now, I dont know how to proeceed to open all those .h files and how to find blank lines.

I have tried grep -n ^$ filename | wc -l, to find the number of blank lines for a particular file.

But I need to know how to make both commands to work together. Please help.
Posted 17-Nov-12 20:23pm by srmohanr.
Tags: