Veja um exemplo:
$ echo "foo" > file
$ grep foo file wrongfile; echo "Exit status: $?"
file:foo
grep: wrongfile: No such file or directory
Exit status: 2
$ grep -q foo file wrongfile; echo "Exit status: $?"
Exit status: 0
Portanto, temos um arquivo chamado file que contém a string foo . Quando executei grep com -q on file e o inexistente wrongfile , já que file continha uma correspondência, grep saiu com 0 status apesar do erro "Nenhum arquivo".