grep filter blank lines and comment lines

1) grep -v option for the exclusion
to exclude empty command line is:
grep -v '^ $' filename

2) # exclude annotation command is:
grep -v '^ #' filename

3) combine is that both exclude blank lines and comment exclude command line
grep -v "^ #" nova.conf | grep -v "^ $"

Guess you like

Origin www.cnblogs.com/gw666/p/12395205.html