With zsh, you can use **/* as a short alternative to using find. Is there any way to restrict that to regular files, that is an equivalent to the -type f option?
Asked
Active
Viewed 2,924 times
1 Answers
10
You can append (.) to a pattern to restrict matches to plain files as long as the Bare_Glob_Qual option is set, which it is by default unless you have zsh emulating some other shell. This is covered in the Glob Qualifiers section of the zshexpn manpage.
So the full pattern to match regular files in the current directory and any of its subdirectories would be **/*(.).
qqx
- 3,013