Ubuntu Can I use SED to search file and remove txt

2017-01-11  Source: Original Site  Category:Ubuntu  Views:246 


If I use the command:

grep some_special_filtering_word_here some_file_name >somenewfile.txt

It goes in a file, finds the line with the filter word you stipulate and then copies that entire line to another file.

That's exactly what I want to do, but instead of copy, I want to remove that line/txt. I have a unique word that I will put in the line so it can be easily distinguished from all other lines that might be in the file.

How can I remove the text and not just copy it.

Is this a sed thing? If so, can anyone show me how this would be done?
Here's an example file with text just to make this easy.

File name is : test.txt and content is:

This is a test
If this works - Yahoo!
Would be great if I could get this to work

In the test.txt file the line to remove has the key/filter word of Yahoo!

Related articles