View Config Files Without Comments

I’ve been using the following grep invocations to trim comments out of config files

 

 

#grep ^[^#] /etc/httpd/conf/httpd.conf
or
#egrep -v "^#|^$" /etc/httpd/conf/httpd.conf
or
#grep -v "^#" /etc/httpd/conf/httpd.conf


source: https://sysadmincorner.wordpress.com/category/aix/
Attachments
There are no attachments for this article.
Related Articles RSS Feed
Bash: String Length – How To Find Out
Viewed 3150 times since Mon, Feb 18, 2019
Script HW/SW AIX
Viewed 10559 times since Mon, Jun 4, 2018
The Ultimate Bash Array Tutorial with 15 Examples
Viewed 14905 times since Sun, Sep 30, 2018
30 Examples for Awk Command in Text Processing
Viewed 16920 times since Sat, Nov 24, 2018
30 Handy Bash Shell Aliases For Linux / Unix / MacOS
Viewed 6471 times since Thu, Feb 11, 2021
Linux / UNIX: Convert Epoch Seconds To the Current Time
Viewed 3939 times since Fri, May 25, 2018
Adding a range of IPs in Linux
Viewed 3524 times since Mon, May 21, 2018
Dealing with Funny Files
Viewed 3648 times since Wed, May 30, 2018
Utilities to Tidy Up Your Reports
Viewed 17194 times since Wed, May 30, 2018
Linux: Repeat Command N Times – Bash FOR Loop
Viewed 4102 times since Mon, Feb 18, 2019