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

Re: listing sub-drectories with most files in



On Sat, Sep 03, 2011 at 08:13:20AM -0700, Bart Schaefer wrote:
> On Sep 3,  2:02pm, Thor Andreassen wrote:
> }
> } find *(/) | cut -d/ -f1 | uniq -c | sort -n
> 
> That'll tell you how many files are in the entire tree below each local
> directory, but not how many files are in each subdirectory in the tree.
 
Right, I didn't read the question well enough. Adding -maxdepth 1 and
-type f to find should limit the result correctly:

find *(/) -maxdepth 1 -type f | cut -d/ -f1 | uniq -c | sort -n

-- 
best regards
Thor Andreassen



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