sed remove all lines starting with code example
Example 1: sed remove empty lines
sed '/^$/d' /tmp/data.txt
Example 2: delete a line starting with sed
# Delete all lines starting with '#'
$ sed -i '/^#/d' filepath
sed '/^$/d' /tmp/data.txt
# Delete all lines starting with '#'
$ sed -i '/^#/d' filepath