Exclude unwanted string from Linux grep

I have a configuration file which is a simple text. I want to list some configuration line but except some sitring. How can I use Linux grep to exclude and search for given strings? Thanks in advance for your help!

cat my_file.txt | grep -v "Text I do not want to see" | grep "Text I do want to see"
2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.