Yes, there is! You can use the sed utility to display the contents of a file, omitting any blank lines, and omitting any lines that start with the "#" character (which denotes that the line is a comment), like this:
sed -e '/^ *#/d' -e '/^$/d' /etc/httpd/conf/httpd.conf
In this example, I am using the sed command to display the content of the httpd.conf file. The -e option allows me to apply an edit to the stream of output. The first edit ('/^ *#/d') instructs sed to search the output for any lines starting with "#" and delete them. The second edit instructs sed to look for blank lines and delete them. It helps to understand basic Regular Expressions, which is an entire other discussion.