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

bash
command-line

(Dmitry Fedyuk) #1
sed -i '/^#/d' <filename.conf>
sed -r -i '/^\s*$/d' <filename.conf>

How to remove comments and empty lines from a `php.ini`?
(Dmitry Fedyuk) #2

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