You can use the
grep command in Linux to remove all lines from a file that start with a specific character.
If you want to edit the file in place, and your version of
sed supports the
-i option, you can use
sed as follows:
sed -i '/^;/d' filename
^; is a regular expression that matches lines that start with
sed to delete those lines.
sed to edit the file in place.
If your version of
sed does not support
-i or you do not want to edit the file in place, you can redirect the output to a new file:
sed '/^;/d' filename > newfile
If you prefer
grep, you can use the
-v the option which inverts the matching, to exclude lines that start with
grep -v '^;' filename > newfile
This will print all lines that do not start with
Remember to replace
filename with the name of the file, you want to modify.