LPI
102-500 · Question #178
What is the difference between the commands test -e path and test -f path?
The correct answer is C. Both options check the existence of the path. The -f option also confirms that it is a regular file.. See the full explanation below for the reasoning.
Question
What is the difference between the commands test -e path and test -f path?
Options
- AThey are equivalent options with the same behaviour.
- BThe -f option tests for a regular file. The -e option tests for an empty file.
- CBoth options check the existence of the path. The -f option also confirms that it is a regular file.
- DThe -f option tests for a regular file. The -e option tests for an executable file.
How the community answered
(39 responses)- A8% (3)
- B3% (1)
- C85% (33)
- D5% (2)
Community Discussion
No community discussion yet for this question.