LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-14-2009, 09:04 AM   #1
Mo-regard
LQ Newbie
 
Registered: May 2009
Posts: 5

Rep: Reputation: 0
Smile 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
 
Old 08-14-2009, 09:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well -type f will give you files, type -d will give you directories.
 
  


Reply

Tags
count, directory


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeRadius Total Thread Count limit ukursat Linux - Server 2 11-26-2008 02:05 PM
tar count archive total matsko Linux - Software 1 01-04-2006 05:14 PM
count total number of lines in several files xushi Programming 5 11-12-2005 04:42 PM
rrdtool total traffic count burn0ut Linux - Networking 3 02-02-2005 07:56 AM
Should posts in general count on your post count? Joey.Dale General 16 01-27-2004 01:31 AM


All times are GMT -5. The time now is 08:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration