April 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930  

Categories

April 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930  

Remove comments and blank lines from configuration files using grep

grep -v ‘^#’ /etc/httpd/conf/httpd.conf | grep -v ‘^$’

Redirect to the file

 grep -v ‘^#’ /etc/httpd/conf/httpd.conf | grep -v ‘^$’  > test

 

 

 

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>