home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] Random Questions #28



On Sunday 28 August 2005 16:31, Wesley J. Landaker wrote:
> On Sunday 28 August 2005 15:28, Sarang Gupta wrote:
> > I believe that only works if there are no subdirectories? I'm looking
> > for output similar to [this is the structure of the Java docs
> > directory, sorted by number of files-- showing only the first few
> > entries since this is just an example]:
> >
> > 9524 .
> > 6918 ./api
> > 3097 ./api/javax
> > 2468 ./api/java
> > 2390 ./guide
>
> Okay, you want something like:
>
> find . -type d -exec sh -c 'echo -ne "{}: "; find {} | wc -l' \; | column
> -t
>
> Enjoy.

And, just in case you're itching for the EXACT formating above, here you go:

find . -type d -exec sh -c 'echo -ne "{}: "; find {} | wc -l' \; | sort -rn 
-k2 | perl -pi -e 's/^(.*): +([0-9]+)$/\2 \1/' | column -t                          

-- 
Wesley J. Landaker <wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.b9.com/pipermail/nmlug/attachments/20050828/cfdd282d/attachment.pgp



Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache