How to delete from a text file, all lines that contain a specific string? Asked 07 September, 2021 Viewed 1.4K times shell sed text-parsing in-place 53 Votes 19 Answers How would I use sed to delete all lines in a text file that contain a specific string? shell sed text-parsing in-place Your reply on this question: Add Reply Cancel 19 Answer Order by Voted Recent Oldest Submit an answer Embed images in Question