-   Linux - Newbie (
-   -   directory and subdirectories (

congos 01-19-2012 08:46 AM

directory and subdirectories
im trying to write a script that finds the number of sub directories in a directory specified

kishore_ari 01-19-2012 08:48 AM

find <specified directory> -type d|wc -l

I hope that helps you.

thesnow 01-19-2012 08:52 AM


find /path/to/directory/* -type d | wc -l
This will exclude the directory itself, if you also want to count that remove the "*"
It will also not follow symlinks, if you want it to do that, add the -L option after "find"

All times are GMT -5. The time now is 07:14 AM.