<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq" -->

---
title: Zsh: uncover hidden files in globs with (D) | daily.dev
description: Zsh globs skip hidden files and directories by default, those starting with a dot. Adding the (D) glob qualifier includes them, for example turning '*' into a...
canonical: https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Zsh: uncover hidden files in globs with (D) | daily.dev
og:description: Zsh globs skip hidden files and directories by default, those starting with a dot. Adding the (D) glob qualifier includes them, for example turning '*' into a...
og:url: https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq
og:image: https://api.daily.dev/og/posts/lTrYB2ZWQ.png
og:image:alt: Zsh: uncover hidden files in globs with (D)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Zsh: uncover hidden files in globs with (D)

**[Adam Johnson](https://daily.dev/sources/adamj)** · 2 min read · 0 upvotes · 0 comments

## Summary

Zsh globs skip hidden files and directories by default, those starting with a dot. Adding the (D) glob qualifier includes them, for example turning '*' into a match that also lists '.env', '.git', and '.github'. This matters most for recursive globs with '**/', since without (D), Zsh also skips hidden directories entirely: '**/*.yml' finds nothing in a repo with YAML files only inside '.github', while '**/*.yml(D)' finds them. The qualifier never matches the special '.' and '..' entries.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://adamj.eu/tech/2026/10/29/zsh-d-glob-qualifier>

## Questions this post answers

### Why does my zsh glob pattern **/*.yml find no matches even though .yml files exist in my repo

Zsh's recursive glob '**/' skips hidden directories by default, so if your YAML files live inside a dot-prefixed folder like '.github', the pattern finds nothing. Adding the '(D)' glob qualifier, for example '**/*.yml(D)', makes zsh include hidden directories and files in the match, revealing files like '.github/dependabot.yml' and '.github/workflows/main.yml'.

_Debugging shell globbing quirks like this is easier when you track zsh tips on daily.dev._

### How do I make zsh's * glob match dotfiles like .env and .git

Append the '(D)' glob qualifier to the pattern, for example 'ls -d *(D)', which includes hidden files and directories (names starting with a dot) in the match. Without it, zsh's '*' only matches non-hidden entries. Note that '(D)' never matches the special '.' and '..' entries, so those won't clutter your results.

_Developers tuning their shell workflow can keep finding practical zsh tricks like this on daily.dev._

## Similar posts on daily.dev

- [Zsh: find the largest files with the \(OL\) glob qualifier](https://daily.dev/posts/zsh-find-the-largest-files-with-the-ol-glob-qualifier-9cv5xzn5k) · Adam Johnson · 5 upvotes · 0 comments
- [Glob patterns explained \(and why .gitignore behaves that way\)](https://daily.dev/posts/glob-patterns-explained-and-why-gitignore-behaves-that-way--dz2lmsm4g) · Flavio Copes · 1 upvotes · 0 comments
- [Zsh: tab complete glob qualifiers](https://daily.dev/posts/zsh-tab-complete-glob-qualifiers-trzdr8umc) · Adam Johnson · 1 upvotes · 0 comments
- [Parse Wildcard Arguments in Bash — Nick Janetakis](https://daily.dev/posts/parse-wildcard-arguments-in-bash-nick-janetakis-g9vroomhd) · Nick Janetakis · 2 upvotes · 1 comments
- [The Many Flavors of Ignore Files](https://daily.dev/posts/the-many-flavors-of-ignore-files-qs2wgw4dz) · Lobsters · 4 upvotes · 0 comments

---

Tags: [#cli](https://daily.dev/tags/cli), [#shell](https://daily.dev/tags/shell), [#bash](https://daily.dev/tags/bash)

[View this post on daily.dev](https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Zsh: uncover hidden files in globs with (D)","url":"https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq"},"datePublished":"2026-10-29T20:58:30.040Z","dateModified":"2026-10-29T20:59:13.705Z","description":"Zsh globs skip hidden files and directories by default, those starting with a dot. Adding the (D) glob qualifier includes them, for example turning '*' into a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5b87fee19e119b3b1c2454958ccdea6e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5b87fee19e119b3b1c2454958ccdea6e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Adam Johnson","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Adam Johnson","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/bf70f4401c284aa5b628d1966029342c","url":"https://daily.dev/sources/adamj"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cli,shell,bash","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Adam Johnson","item":"https://daily.dev/sources/adamj"},{"@type":"ListItem","position":3,"name":"Zsh: uncover hidden files in globs with (D)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/zsh-uncover-hidden-files-in-globs-with-d--ltryb2zwq#faq","mainEntity":[{"@type":"Question","name":"Why does my zsh glob pattern **/*.yml find no matches even though .yml files exist in my repo","acceptedAnswer":{"@type":"Answer","text":"Zsh's recursive glob '**/' skips hidden directories by default, so if your YAML files live inside a dot-prefixed folder like '.github', the pattern finds nothing. Adding the '(D)' glob qualifier, for example '**/*.yml(D)', makes zsh include hidden directories and files in the match, revealing files like '.github/dependabot.yml' and '.github/workflows/main.yml'. Debugging shell globbing quirks like this is easier when you track zsh tips on daily.dev."}},{"@type":"Question","name":"How do I make zsh's * glob match dotfiles like .env and .git","acceptedAnswer":{"@type":"Answer","text":"Append the '(D)' glob qualifier to the pattern, for example 'ls -d *(D)', which includes hidden files and directories (names starting with a dot) in the match. Without it, zsh's '*' only matches non-hidden entries. Note that '(D)' never matches the special '.' and '..' entries, so those won't clutter your results. Developers tuning their shell workflow can keep finding practical zsh tricks like this on daily.dev."}}]}
```

