You can use this way...
grep -P '^\s$' file
-P
is used for Perl regular expressions (an extension to POSIX grep
).\s
match the white space characters; if followed by *
, it matches an empty line also.^
matches the beginning of the line. $
matches the end of the line.