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
“Yes/No” in Bash Script – Prompt for Confirmation
Viewed 36377 times since Mon, Feb 18, 2019
Epoch & Unix Timestamp Conversion Tools
Viewed 84966 times since Fri, Jun 22, 2018
30 Handy Bash Shell Aliases For Linux / Unix / MacOS
Viewed 6471 times since Thu, Feb 11, 2021
How to sort IP addresses in Linux
Viewed 4777 times since Thu, May 24, 2018
How to get a password from a shell script without echoing - solutions
Viewed 16137 times since Fri, Feb 22, 2019
Display basic information about Physical Volumes
Viewed 4530 times since Sun, Jun 3, 2018
awk printf
Viewed 17454 times since Wed, Aug 19, 2020
O’Reilly’s CD bookshelf
Viewed 15717 times since Wed, Jun 27, 2018
Bash: Read File Line By Line – While Read Line Loop
Viewed 3309 times since Mon, Feb 18, 2019
30 Examples for Awk Command in Text Processing
Viewed 16918 times since Sat, Nov 24, 2018