sed -e '/MatchThisString/ s/^/#/' -i file
This will add a # in front of all the lines that are matching the string “MatchThisString“
sed -e '/MatchThisString/ s/^/#/' -i file
This will add a # in front of all the lines that are matching the string “MatchThisString“