# Example using /etc/my.cnf to easily view DB config in Linux grep -v -e ^# -e ^$ /etc/my.cnf # copy to new file... grep -v -e ^# -e ^$ /etc/my.cnf > /etc/my-nocomments.cnf # tested in bash amazon ec2 instance ubuntu 12.04