From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: kdea@alpine-la.com Newsgroups: gmane.os.tru64.managers Subject: [SUMMARY] counting the number of files under an entire directory tree Date: Thu, 26 May 2005 10:20:15 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117128031 27298 80.91.229.2 (26 May 2005 17:20:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 May 2005 17:20:31 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Thu May 26 19:20:23 2005 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by ciao.gmane.org with smtp (Exim 4.43) id 1DbM0N-0001Fa-L4 for gotm-tru64-unix-managers@gmane.org; Thu, 26 May 2005 19:18:48 +0200 Original-Received: (qmail 23423 invoked by uid 49509); 26 May 2005 17:20:36 -0000 Original-Sender: tru64-unix-managers-owner@ornl.gov Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 23408 invoked by uid 49501); 26 May 2005 17:20:36 -0000 Original-Received: from 160.91.86.17 by sws1 (envelope-from , uid 49491) with qmail-scanner-1.25 (clamdscan: 0.83/743. spamassassin: 3.0.2. Clear:RC:0(160.91.86.17):SA:0(-2.6/5.0):. Processed in 0.182877 secs); 26 May 2005 17:20:36 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 Original-Received: from emroute2.cind.ornl.gov (160.91.86.17) by sws1.ornl.gov with SMTP; 26 May 2005 17:20:35 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0IH300M8MXI88W@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 26 May 2005 13:20:35 -0400 (EDT) Original-Received: from VIRUSCAN-DAEMON.emroute2.cind.ornl.gov by emroute2.cind.ornl.gov (PMDF V6.2-X27 #30899) id <0IH300302XHTW9@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 26 May 2005 13:20:25 -0400 (EDT) Original-Received: from pop-cowbird.atl.sa.earthlink.net (pop-cowbird.atl.sa.earthlink.net [207.69.195.68]) by emroute2.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0IH300IIXXHSZM@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 26 May 2005 13:20:17 -0400 (EDT) Original-Received: from user-119bt68.biz.mindspring.com ([66.149.244.200] helo=sneezy.alpine-la.com) by pop-cowbird.atl.sa.earthlink.net with esmtp (Exim 3.36 #10) id 1DbM1o-0002CG-00 for tru64-unix-managers@ornl.gov; Thu, 26 May 2005 13:20:16 -0400 In-reply-to: Original-To: tru64-unix-managers@ornl.gov X-Mailer: Lotus Notes Release 6.5.1 January 21, 2004 X-MIMETrack: Serialize by Router on sneezy/Alpine-La(Release 5.0.12 |February 13, 2003) at 05/26/2005 10:20:16 AM X-Envelope-From: X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on email.cind.ornl.gov X-Spam-Level: X-Qmail-Scanner-MOVED-X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,NO_REAL_NAME, SPF_HELO_PASS autolearn=no version=3.0.3 Xref: news.gmane.org gmane.os.tru64.managers:8321 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:8321 Wow, Less than 5 minutes and got several replies. The simpliest which I needed, to count EVERYTHING under a directory was to use: find | wc -l There are other ways to only count symlinks, directories, or files using 'find'. For example only looking for files, use: find /usr -type f | wc -l Thanks to everyone who replied with the answers! Kevin ---original question--- We have a directory with a huge number of directories and subdirectories, sub-subdirectories, and files. Does anyone know a command or a series of piped commands (presumably including 'wc') to count exactly the number of files and directories under a specific directory? ES40 running Tru64 5.1a.