If Then: File Operations Flashcards

1
Q

[ -s FILE ]

A

File exists
and size is > 0 bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

[ -f FILE ]

A

File exists
and is not a directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

[ -d FILE ]

A

Directory exists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

[ -x FILE ]

A

File is executable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

[ -w FILE ]

A

File is writable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

[ -r FILE ]

A

File is readable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

[ -e FILE ]

A

File exists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

[ FILE1 -nt FILE2 ]

A

1 is more recent than 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

[ FILE1 -ot FILE2 ]

A

2 is more recent than 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

[ FILE1 -ef FILE2 ]

A

Same files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly