Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#test
#file-testing
#regular-file
#path-existence
Medio

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

A

They are equivalent options with the same behavior.

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.

Correcto
D

The -f option tests for a regular file. The -e option tests for an executable file.

Explicación Oficial / Explicaciones de la Comunidad

test -e returns true if the file exists (any type). test -f returns true only if the file exists and is a regular file.