Here is how you can remove comments ( the ones starting with # ) from configuration files : This will remove all comments from Apache's configuration file.
Archive for the ‘sed’ Category
Remove comments from configuration files
Posted: 23rd April 2010 by Valkyrka in bash, one-liner, sed, shell1
In order to remove the Ctrl+M characters at the end of the file when moving files from Windows -> Unix, you can do this using sed :
Here is how you can delete a line which contains a specific string from a file : This will delete the line which contains the string 'string' on it from /var/log/messages.