How do you grep blank lines in Unix?

How do you grep blank lines in Unix?
Answer
To match empty lines, use the pattern ‘ ^$ ‘. To match blank lines, use the pattern ‘
^[[:blank:]]*$
‘. To match no lines at all, use the command ‘ grep -f /dev/null ‘.
 

Tìm kiếm

Back
Top