file-test
Bash -d file test
True for a directory.
Formal Syntax & Structure
bash syntaxbash
[ -d path ]Return Value
exit status
True for a directory.
Working Example
Example Snippetbash
mkdir folder[ -d 'folder' ]printf '%s\n' "$?"True for a directory.
[ -d path ]True for a directory.
mkdir folder[ -d 'folder' ]printf '%s\n' "$?"