-f FILE (conditional operator)

true if the file exists and is a regular file.

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 ist eine Bash IDE mit Unterstützung für -fprobieren Sie es aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches