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

Re: listing sub-drectories with most files in



On Sep 3, 2011, at 8:02 AM, Thor Andreassen wrote:

> On Fri, Sep 02, 2011 at 03:24:14PM +0000, 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.
> 
> find *(/) | cut -d/ -f1 | uniq -c | sort -n

or

(for d (**/*(/)) echo `ls $d|wc -l` $d)|sort -n
-- 
Aaron Davies
aaron.davies@xxxxxxxxx



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