Linux Foundation Certified System Administrator (LFCS) — Question 26

What is the difference between the commands test -e path and test -f path?

Answer options

Correct answer: C

Explanation

The correct answer is C because both -e and -f options check if the specified path exists, but -f specifically verifies that the path is a regular file. Options A, B, and D are incorrect as they misinterpret the functionality of the -e and -f options, particularly regarding what constitutes a regular file and the nature of the checks performed.