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

Re: listing sub-drectories with most files in



On Fri, Sep 02, 2011 at 03:24:14PM +0000, zzapper wrote:
> Hi,
> 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.
> 
> I guess an easy job for zsh?

Alternative way:

find *(/) | cut -d/ -f1 | uniq -c | sort -n

-- 
best regards
Thor Andreassen



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