How do you delete all lines in a file that begin with \"string\" in sh? I was thinking about using the sed command.
You can use Vim in Ex mode:
ex -sc g/^string/d -cx file
g select all matching lines
g
d delete
d
x save and close
x