Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How do I (*|*/*) ?



> On Apr 12, 2026, at 18:13, dana <dana@xxxxxxx> wrote:
> 
> On Sun 12 Apr 2026, at 17:55, Philippe Altherr wrote:
>> You can use ** instead of (*|*/*|*/*/*) but it won't limit itself to a
>> maximum of 3 directories (see Recursive Globbing for more details). If
>> the limiting is crucial, you can do that afterwards by filtering the
>> result with ${name:#pattern}.
> 
> i was going to suggest this:
> 
>  */**/.DS_Store~*/*/*/*/*(OL[1,5])
> 
> as you said it will descend as far as it can, which will make it slower
> than necessary, but it's probably fine unless it's an extremely deep
> file structure or it's on a slow fs like a network share
> 
> if there's a better way i can't think of it atm

Thank you to both of you.  I was in my home directory and ** would take too long.  This all started from just a whim.  I didn’t know .DS_Store files (the files used by the Finder on macOS) grew to be 100K big.  I just wanted a smattering of .DS_Store files sorted by size.  Turns out, ls can do that with -S.  But, the basic question has been something I kept meaning to explore.

As far as the Note… Dahh!!! Sorry.  I really did look.  I assumed such a note would be with the a or b components of the a|b syntax.  I need to look one paragraph up.  :-(






Messages sorted by: Reverse Date, Date, Thread, Author