If you want to do something if both A and B are
not on the same line:
Code:
grep 'A' file.txt | grep -q 'B' || echo "Do something"
If you want to do something if both A and B are
not present in the entire file:
Code:
FILE="file.txt" ; grep -q 'bbbb' $FILE || grep -q 'aaaa' $FILE || echo "Do something"