Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: listing sub-drectories with most files in
- X-seq: zsh-users 16303
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: listing sub-drectories with most files in
- Date: Fri, 02 Sep 2011 10:03:13 -0700
- In-reply-to: <Xns9F54A6DEAC33Bzzappergmailcom@80.91.229.10>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <Xns9F54A6DEAC33Bzzappergmailcom@80.91.229.10>
On Sep 2, 3:24pm, zzapper wrote:
}
} I'm grepping a tree (grep string **/*) and want to list the
} subdirectories which have the most files. This is because the grep is
} taking ages and I'm hoping I can exclude some of these.
This will give you the directories and the count of files in each,
in ascending order by number of files:
print **/*(/ne{'reply=($REPLY/*(N.)); reply=($#reply\:$REPLY)'})
I'll leave it up to you to decide how you want to make use of that
information.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author