-f FILE (conditional operator)
true
if the file exists and is a regular file.
Links
Examples
- Different ways to test if a file is a regular file:
1 2 3 4
test -f ~/file.txt && echo "regular file" [ -f ~/file.txt ] && echo "regular file" # Bash [[ -f ~/file.txt ]] && echo "regular file"
BashSupport Pro 是一个 支持 -f 的 Bash 集成开发工具 – 马上试用!