Search code examples
shellzshglob

How to use a glob pattern to find files in hidden directories using zsh


In zsh, echo **/asdf lists every file named asdf in the current directory and any subdirectories. But it doesn't search subdirectories whose names start with .. For example it wouldn't find .x/asdf. Is there a different pattern that can be used to also search hidden directories?


Solution

  • ls **/asdf(D)
    

    should do the job. D turns on dotglob for this pattern.