Removing a sentence that contains a specific word is a simple task with regular expressions. This recipe demonstrates techniques for solving similar problems.
Removing a sentence in a file containing a word
Getting ready
sed is the best utility for making substitutions. This recipe uses sed to replace the matched sentence with a blank.
How to do it...
Let's create a file with some text to carry out the substitutions. Consider this example:
$ cat sentence.txt Linux refers to the family of Unix-like computer operating systems that use the Linux kernel. Linux can be installed on a wide variety ...