sed replace lines not matching pattern code example
Example: sed replace with no line
Use d option at the end of sed command string for deleting line of matches.
sed -i "" "s/matching_pattern/d" file.txt
Use d option at the end of sed command string for deleting line of matches.
sed -i "" "s/matching_pattern/d" file.txt