Is there a way to use shell globbing to identify nested directories?
so if I have dir/dir1/dir2/dir3/dir4/dir5/.. and I have files under all of them, what is the equivalent globbing pattern to match all files under all directories, similar to - for example - ls -R
In Bash 4, with
shopt -s globstar, and zsh you can use**/*which will include everything except hidden files. You can doshopt -s dotglobin Bash 4 orsetopt dotglobin zsh to cause hidden files to be included.In ksh,
set -o globstarenables it. I don't think there's a way to include dot files implicitly, but I think**/{.[^.],}*works.