If Then: File Operations Flashcards
1
Q
[ -s FILE ]
A
File exists
and size is > 0 bytes
2
Q
[ -f FILE ]
A
File exists
and is not a directory
3
Q
[ -d FILE ]
A
Directory exists
4
Q
[ -x FILE ]
A
File is executable
5
Q
[ -w FILE ]
A
File is writable
6
Q
[ -r FILE ]
A
File is readable
7
Q
[ -e FILE ]
A
File exists
8
Q
[ FILE1 -nt FILE2 ]
A
1 is more recent than 2
9
Q
[ FILE1 -ot FILE2 ]
A
2 is more recent than 1
10
Q
[ FILE1 -ef FILE2 ]
A
Same files