Bash utils:
Copied from here
File tests
This section probably holds the most tests, I'll list them in some
logical order. Since Bash 4.1, all tests related to permissions respect
ACLs, if the underlying filesystem/OS supports them.
| Operator syntax | Description | |
|---|---|---|
| -a | True if -a for AND, see below) | |
| -e | True if | |
| -f | True, if | |
| -d | True, if |
|
| -c | True, if | |
| -b | True, if | |
| -p | True, if | |
| -S | True, if | |
| -L | True, if | |
| -h | True, if | |
| -g | True, if | |
| -u | True, if | |
| -r | True, if | |
| -w | True, if | |
| -x | True, if | |
| -s | True, if | |
| -t | True, if file descriptor | |
| True, if | ||
| True, if | ||
| True, if | ||
String tests
| Operator syntax | Description |
|---|---|
| -z | True, if |
| -n | True, if |
| True, if the strings are equal. | |
| True, if the strings are not equal. | |
True if \< |
|
True if \> |
Arithmetic tests
| Operator syntax | Description |
|---|---|
| True, if the integers are equal. | |
| True, if the integers are NOT equal. | |
| True, if the first integer is less than or equal second one. | |
| True, if the first integer is greater than or equal second one. | |
| True, if the first integer is less than second one. | |
| True, if the first integer is greater than second one. |
Misc syntax
| Operator syntax | Description |
|---|---|
| | True, if -a also may be used as a file test (see above) |
| | True, if either |
| ! | True, if |
| ( | Group a test (for precedence). Attention: In normal shell-usage, the "(" and ")" must be escaped; use "\(" and "\)"! |
| -o | True, if the shell option |
| -v | True if the variable var[n] for array elements. |
| -R | True if the variable |
Copied from here