file-test
Bash -e file test
True if the path resolves to an existing file or directory.
Formal Syntax & Structure
bash syntaxbash
[ -e path ]Return Value
exit status
True if the path resolves to an existing file or directory.
Working Example
Example Snippetbash
: > file.txt[ -e 'file.txt' ]printf '%s\n' "$?"