How to remove the `#` and `;` comments and empty lines from a configuration file?

sed -i -r '/^[\s\t]*[#;]/d' <file>
sed -i -r '/^\s*$/d' <file>

See also: How to remove comments and empty lines from a php.ini?

For all files in the current folder:

find . -type f -exec sed -i -r '/^[\s\t]*[#;]/d' {} +
find . -type f -exec sed -i -r '/^\s*$/d' {} +