-d FILE (conditional operator)

true if the file is a directory.

Examples

Different ways to test if a file is a directory:
1
2
3
4
test -d /opt && echo "directory"
[ -d /opt ] && echo "directory"
# Bash
[[ -d /opt ]] && echo "directory"
BashSupport Pro ist eine Bash IDE mit Unterstützung für -dprobieren Sie es aus!
© 2020–2023 Joachim Ansorg
Impressum
Datenschutz
Rechtliches