Linux Administration
medium

Questão de Linux Administration #019e3987

Enunciado da Questão
Linux Administration
#test
#file-testing
#regular-file
#path-existence
Médio

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.

Correta
D

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

Explicação Oficial / Explicações da Comunidade

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