How Count Blank Lines in Unix?
Contents

How do you count blank lines in Unix?

I cat file; apply grep with -v (exclude from enumerated) and [^$] (final line, contents “null”). Then I pipe for wc , parameter -l (just count lines). Done.

How do I count lines in Linux?

The most easiest way to count the number of lines, words, and characters in text file is to use the Linux command “wc” in terminal. The command “wc” basically means “word count” and with different optional parameters one can use it to count the number of lines, words, and characters in a text file.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest