[Gllug] counting subdirectories

Richard Cohen richard at vmlinuz.org
Tue Oct 14 14:49:51 UTC 2003


On Tue, 14 Oct 2003, stanley wrote:

> Hopefully this will be an easy one for most,

Yes, it is :-)

> 	For my university coursework I have been asked to create an alias that will
> count and display the number of subdirectories in one directory, and so far
> the best I have managed is
>
> alias dc="ls -1aF | grep "/" | wc -l"
>
> this work but also includes the parent and root directories in the count.
> Anyone with any tips.

Try "man find" :-)  Oh, and possibly "man tail"...

> TIA
>
> Stan

Cheers
Richard

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list