# test `[[` `]]` is better, it's a shell keyword ## test operators Below, the tests marked with `:!:` are non-standard tests ``` Operator syntax Description -a True if exists. :!: (not recommended, may collide with -a for AND, see below) -e True if exists. -f True, if exists and is a regular file. -d True, if exists and is a directory. -c True, if exists and is a character special file. -b True, if exists and is a block special file. -p True, if exists and is a named pipe (FIFO). -S True, if exists and is a socket file. -L True, if exists and is a symbolic link. -h True, if exists and is a symbolic link. -g True, if exists and has sgid bit set. -u True, if exists and has suid bit set. -r True, if exists and is readable. -w True, if exists and is writable. -x True, if exists and is executable. -s True, if exists and has size bigger than 0 (not empty). -t True, if file descriptor is open and refers to a terminal. -nt True, if is newer than (mtime). :!: -ot True, if is older than (mtime). :!: -ef True, if and refer to the same device and inode numbers. :!: ```