Linux : How to Remove Lines or a String From a File in Shell
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
print the output to standard out, without specify " -i " option
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
Directly update to that file
Remove the lines between lines 2 to 5