Display the contents of a config file without commented out or blank lines

"Hi Pete! Is there a way that I can easily display the contents of a Linux config file, without showing all the commented out lines, and all the blank lines?"

This is easy to do with sed. Keep this one-line-command in your notes:


sed -e '/^ *#/d' -e '/^$/d' /etc/httpd/conf/httpd.conf
 
We're telling the sed command to display a file to STDOUT after performing
two edits (-e) on the output stream. The first one deletes all lines that
start with a pound sign (#), and the second edit deletes all blank lines. 
These deletes are not changes to the file itself! All that is changed is
the data sent to STDOUT.