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
10 Xargs Command Examples in Linux / UNIX
Viewed 4119 times since Fri, Jun 1, 2018
awk printf
Viewed 15519 times since Wed, Aug 19, 2020
How to get a password from a shell script without echoing - solutions
Viewed 14048 times since Fri, Feb 22, 2019
Bash: Read File Line By Line – While Read Line Loop
Viewed 2378 times since Mon, Feb 18, 2019
perl podstawy
Viewed 2134 times since Mon, May 21, 2018
8 Practical Examples of Linux Xargs Command for Beginners
Viewed 5663 times since Fri, Jun 1, 2018
Time conversion using Bash
Viewed 2833 times since Fri, May 25, 2018
10 Awk Tips, Tricks and Pitfalls
Viewed 6097 times since Wed, Aug 19, 2020
Epoch & Unix Timestamp Conversion Tools
Viewed 63260 times since Fri, Jun 22, 2018
Transform XML to CSV Format | Unix String Pattern Manipulation The Ugly Way
Viewed 5920 times since Sun, Jan 9, 2022