Monthly Archives: July 2023

Remove comment lines and empty lines from a file

Sometimes you have a config file with a lot of comments and empty lines, which you don’t need, because they hide the relevant information. So use this to simplify it:

cat your.file | grep -v '^#' | grep -v '^$'