SUMMARY: [Q] number of line on a file ??

unixadm@www.co.mo.md.us
Mon, 02 Jun 1997 18:10:05 -0400 (EDT)

Thank you for so many people give me the answers. The solution can be
following way:

grep -v '^$' myfile | wc -l

sed -e '/^$/d' <file> | wc -l

nl file|sort|uniq|wc -l

cat -n file |tail will do the trick.

My original post:

>I have SOLARIS 2.5 installed. I tried to count how many NONE empty line
>on a file. No matter I use "nl file|wc -l" or "nl -bt file|wc -l", it
>still count empty line as a line. Does anyone can tell me what i am
>wrong? Does their has any other utility can do the same thing? Thank
>you for help.