| -h |
file is a symbolic link |
if [ -h "$f" ] |
| -L |
file is a symbolic link |
if [ -L "$f" ] |
| -S |
file is a socket |
if [ -S "$f" ] |
| -t |
file (descriptor) is associated with a terminal device |
if [ -t "$f" ] |
| -r |
file has read permission (for the user running the test) |
if [ -r "$f" ] |
| -w |
file has write permission (for the user running the test) |
if [ -w "$f" ] |
| -x |
file has execute permission (for the user running the test) |
if [ -x "$f" ] |
| -g |
set-group-id (sgid) flag set on file or directory |
if [ -g "$f" ] |
| -u |
set-user-id (suid) flag set on file |
if [ -u "$f" ] |
| -k |
sticky bit set |
if [ -k "$f" ] |
| -O |
you are owner of file |
if [ -O "$f" ] |
| -G |
group-id of file same as yours |
if [ -G "$f" ] |
| -N |
file modified since it was last read |
if [ -N "$f" ] |
| f1 -nt f2 |
file f1 is newer than f2 |
if [ f1 -nt f2 "$f" ] |
| f1 -ot f2 |
file f1 is older than f2 |
if [ f1 -ot f2 "$f" ] |
| f1 -ef f2 |
files f1 and f2 are hard links to the same file |
if [ f1 -ef f2 "$f" ] |
| ! |
“not” – reverses the sense of the tests above (returns true if condition absent). |
if [ ! "$f" ] |