By far, the command used most frequently with
test. The test command performs a variety of checks and comparisons. It has two equivalent forms:
and the more popular
expression is an expression that is evaluated as either true or false. The
test command returns an exit status of 0 when the expression is true and a status of 1 when the expression is false.
The expressions in Table 27-1 are used to evaluate the status of files.
Table 27-1. test File Expressions
Is true if . . .