nerdexam
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)
  • A
    8% (3)
  • B
    3% (1)
  • C
    85% (33)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice