File: grep.info, Node: Exit Status, Next: grep Programs, Prev: Environment Variables, Up: Invoking 2.3 Exit Status =============== Normally the exit status is 0 if a line is selected, 1 if no lines were selected, and 2 if an error occurred. However, if the ‘-q’ or ‘--quiet’ or ‘--silent’ option is used and a line is selected, the exit status is 0 even if an error occurred. Other ‘grep’ implementations may exit with status greater than 2 on error.