for dir in *; do if [ -d "$dir" ]; then # or: if test -d "$dir"; then ( cd "$dir" && docker-compose up -d ) fi done