I am using rg
(or alternatively ag
) to search for occurrences of a string in a folder with many files, like this:
$ rg "cat"
lolo
3:cat
lala
2:cat
Now I would like to get rid of these matches.
How can I remove each line containing a match from every file with matches?