Hello,
Have you ever wondered how to view the Linux configurations files without those comments? Well those comments are indeed helpful, but think about configuration files such as httpd.conf and squid.conf files. These files have good amount of commented lines.
The issue with the httpd.conf file in particular is that not all commented lines starts with #. Some commented lines start after a tab.
Example:
# egrep -v "^$|*#" /etc/httpd/conf/httpd.conf
Or
# sed '/ *#/d; /^ *$/d' /etc/httpd/conf/httpd.conf
Hope this helps.
Regards,
Jay
Have you ever wondered how to view the Linux configurations files without those comments? Well those comments are indeed helpful, but think about configuration files such as httpd.conf and squid.conf files. These files have good amount of commented lines.
The issue with the httpd.conf file in particular is that not all commented lines starts with #. Some commented lines start after a tab.
Example:
# Further relax access to the default document root:You could remove those tabbed comments as well using "sed" or using "egrep" with proper Regex.
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
# egrep -v "^$|*#" /etc/httpd/conf/httpd.conf
Or
# sed '/ *#/d; /^ *$/d' /etc/httpd/conf/httpd.conf
Hope this helps.
Regards,
Jay