LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need a way to count sub-directories and get a total count (https://www.linuxquestions.org/questions/linux-newbie-8/need-a-way-to-count-sub-directories-and-get-a-total-count-747533/)

Mo-regard 08-14-2009 09:04 AM

Need a way to count sub-directories and get a total count
 
I am trying to figure out a way to list and count all directories with subdirectories below it and then give a summary count and extract that to a flatfile to put into excel.

Background:
I copied a number of old DLT tapes to my system. I created a directory for each tape and then dumped the contents of each tape into this directory. Each subdirectory is symbolic of a record. So i basically need a tally count of all the subdirectories so that I can match that number up against my database to ensure that everything copied over.

I tried
find . -type f -print | wc -l
put it just does not give me what I need.


This system does not have internet access and I am remote into it but locked down by a vpn so I cant copy any utilities such as the tree command.

Please help

acid_kewpie 08-14-2009 09:10 AM

well -type f will give you files, type -d will give you directories.


All times are GMT -5. The time now is 07:42 PM.