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

A. They are equivalent options with the same behaviour.
B. The -f option tests for a regular file. The -e option tests for an empty file.
C. Both options check the existence of the path. The -f option also confirms that it is a regular file.
D. The -f option tests for a regular file. The -e option tests for an executable file.

题解

「test」指令可以检查文件或是比较数值。「-e」参数用来判断文件是否存在。「-f」参数用来判断文件是否存在且是否为正规文件(regular file),正规文件是,文件类型符号为「-」的文件,如果是符号链接,则要去判断最终链接到的文件。所以答案是选项 C。