How do you delete all lines that begin with “string” in unix sh? April 4, 2024 by Tarik To do it in place, if your sed supports the -i option, you can do: sed -i '/^string/d' input-file