test - check file types and compare values

Synopsis

test EXPRESSION test [ EXPRESSION ] [ ] [ OPTION

Description

( EXPRESSION ) EXPRESSION is true ! EXPRESSION EXPRESSION is false -n STRING the length of STRING is nonzero STRING equivalent to -n STRING -z STRING the length of STRING is zero STRING1 = STRING2 the strings are equal STRING1 != STRING2 the strings are not equal INTEGER1 -eq INTEGER2 INTEGER1 is equal to INTEGER2 INTEGER1 -ge INTEGER2 INTEGER1 is greater than or equal to INTEGER2 INTEGER1 -gt INTEGER2 INTEGER1 is greater than INTEGER2 -d FILE FILE exists and is a directory -e FILE FILE exists -f FILE FILE exists and is a regular file FILE1 -nt FILE2 FILE1 is newer (modification date) than FILE2 FILE1 -ot FILE2 FILE1 is older than FILE2 -w FILE FILE exists and write permission is granted -x FILE FILE exists and execute (or search) permission is granted