How do you grep an empty line?

Nguyên Lê

New member
How do you grep an empty line?
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