Use the following sed command to clean up config files and remove all the comments and blank lines: .. code-block:: sh sed '/ *#/d; /^ *$/d'