[ -a FILE ] |
FILE true if it exists. |
[ -b FILE ] |
True if it FILE exists and is a block special file. |
[ -c FILE ] |
FILE true if a special file is present and is a word. |
[ -d FILE ] |
True if it FILE exists and is a directory. |
[ -e FILE ] |
FILE true if it exists. |
[ -f FILE ] |
True if it FILE exists and is an ordinary file. |
[ -g FILE ] |
FILE true if Sgid is present and has been set. |
[ -h FILE ] |
True if it FILE exists and is a symbolic connection. |
[ -k FILE ] |
True if the FILE sticky bit is present and has been set. |
[ -p FILE ] |
True if it FILE exists and is a name pipe (f if o). |
[ -r FILE ] |
True if it FILE exists and is readable. |
[ -s FILE ] |
FILE true if it exists and the size is not 0. |
[ -t FD ] |
True if the file descriptor is FD open and points to a terminal. |
[ -u FILE ] |
True if the FILE suid (set user ID) is present and set. |
[ -w FILE ] |
FILE true if FILE exists and is writable. |
[ -x FILE ] |
True if it FILE exists and is executable. |
[ -O FILE ] |
FILE true if it exists and is a valid user ID. |
[ -G FILE ] |
FILE true if it exists and is a valid user group. |
[ -L FILE ] |
True if it FILE exists and is a symbolic connection. |
[ -N FILE ] |
If FILE an and has been mod is present, if the IED since it is last read is true. |
[ -S FILE ] |
True if it FILE exists and is a socket. |
[file1 -nt file2 ] |
if file1 has been Changed more recently than file2 , or if file1 exists and file2 does not is true. |
[file1 -ot file2 ] |
if file1 than file2 to be old, or file2 exists and file1 The is true if it does not exist. |
[ FILE1 -ef FILE2 ] |
FILE1 true if and FILE2 point to the same device and node number. |
[ -o Optionname] |
True if the shell option "optionname" is turned on. |
[ -z STRING] |
"STRING" is true if the length is zero. |
[ -n String] or [string] |
Thelength of "STRING" is not 0 Non-zero is true. |
[STRING1 = = STRING2] |
If 2 strings are the same. "=" May is used instead of "= =" For strict POSIX compliance is true. |
[STRING1! = STRING2] |
True if the strings are not equal. |
[STRING1 < STRING2] |
If the "STRING1" sorts before "STRING2" lexicographically The current locale is true. |
[STRING1 > STRING2] |
If the "STRING1" sorts after "STRING2" lexicographically The current locale is true. |
[ARG1 OP ARG2] |
"OP" is one -eq of,,, -ne -lt -le , -gt or -ge . These arithmetic binary operators return True if "ARG1" is equal to, not equal to, less than, less than or equal to, g Reater than, or greater than or equal to "ARG2", respectively. "ARG1" and "ARG2" are integers. |