-d FILE (conditional operator)
true
if the file is a directory.
Links
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 是一个 支持 -d 的 Bash 集成开发工具 – 马上试用!