In the Linux if ones aim is to remove lines from certain file, one can use following command:

sed -i '/unwanted phrasse/d' file

It will remove all lines containing unwanted phrasse.


Another way using echo and grep. But is tricky, do not forget quotation marks or else lines can be stuck into one line
echo "$(grep -v "unwanted phrasse" file)" > file