I was wondering if there is a way to specify the first N files under a given a directory in zsh.
I am interested in solutions for recursive enumeration (i.e. any file recursively below a path is considered for the enumeration) and non-recursive (only those files strictly under a given folder are considered).
Thanks!
Best Answer
It's zsh, so indeed there's a glob qualifier for that.
Other qualifiers that might be useful, for example the following expression includes dot files (
D
), restricts to regular files (.
) and symbolic links (-
) to regular files, and expands to an empty list if there is no match (N
):