The regular expression to match the end of the line is $, not \n (since grep works a line at a time, it ignores the newlines between lines).
grep -c '^$' myfile.txt
The regular expression to match the end of the line is $, not \n (since grep works a line at a time, it ignores the newlines between lines).
grep -c '^$' myfile.txt