Test for directory presence.
Section: Conditionals Loops and Functions
Check whether directory exists
bash
bash
if [[ -d releases ]]; then ls releases; fiExplanation
Useful for deployment and housekeeping scripts.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Conditionals Loops and Functions