file-test
Bash -f file test
True for a regular file.
Formal Syntax & Structure
bash syntaxbash
[ -f path ]Return Value
exit status
True for a regular file.
Working Example
Example Snippetbash
: > file.txt[ -f 'file.txt' ]printf '%s\n' "$?"True for a regular file.
[ -f path ]True for a regular file.
: > file.txt[ -f 'file.txt' ]printf '%s\n' "$?"