bash sed code example
Example 1: bash sed output
Just use something like following with p option at sed command`s end:
cat file.txt| sed -En "s/string_to_replace/replacement_string/p"
Example 2: sed line
Use d option at the end of sed replace definition for deleting line of matches.
sed -i "" "s/matching_pattern/d" file.txt