Q:

How to grep for "STRING1" but skip if the line contains "STRING2"?

I want to search for "STRING1" using grep but to skip if the line contains "STRING2". How can I do it?

A:

This will do:
 grep -v "STRING2" file | grep "STRING1"

