We have already discussed about find and replace a line or specific word in simple commands using SED.

Remove a word from the file.

For example, command will remove a word "windows" from linux.txt file

  sed -i 's/windows//g' file_name.txt

print the output to standard out, without specify  " -i " option
  sed 's/windows//g' linux.txt

Remove a line containing a specific word:

remove the whole line in a file_name.txt file contains a specific string

print the output to standard out
 sed   '/type string/d'

Directly update to that file
 sed -i '/type string/d'

Remove the lines between lines 2 to 5
sed -i '2,5d' clear_file.sh