File conditions
Condition | Description |
---|---|
[[ -e FILE ]] |
Exists |
[[ -d FILE ]] |
Directory |
[[ -f FILE ]] |
File |
[[ -h FILE ]] |
Symlink |
[[ -s FILE ]] |
Size is > 0 bytes |
[[ -r FILE ]] |
Readable |
[[ -w FILE ]] |
Writable |
[[ -x FILE ]] |
Executable |
[[ f1 -nt f2 ]] |
f1 newer than f2 |
[[ f1 -ot f2 ]] |
f2 older than f1 |
[[ f1 -ef f2 ]] |
Same files |
Comments