Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tlug: file counting
- To: tlug@example.com
 - Subject: Re: tlug: file counting
 - From: Scott Stone <sstone@example.com>
 - Date: Mon, 12 Oct 1998 09:39:37 +0900 (JST)
 - Content-Type: TEXT/PLAIN; charset=US-ASCII
 - In-Reply-To: <XFMail.981011215538.schweiz@example.com>
 - Reply-To: tlug@example.com
 - Sender: owner-tlug@example.com
 
On Sun, 11 Oct 1998, Jim Schweizer wrote: > Hi all, > > Sounds like there was another successful meeting - wish I could have been there. > > I was playing around with different ways of counting files recursively through > directories such as a .bashrc alias like > > alias numf='find ./ -type f | wc -l' > > but this isn't really what I want because you have to cd to the desired > directory to use it. So I wrote a shell script > > #! /bin/bash > > # count the number of files below a given (STDIN) directory > find $1 -type f | wc -l > > and this does pretty much what I want it to. So, why does > > alias numf="find $1 -type f | wc -l' only count the directory and not the > files? cat $1 | find -f | wc -l doesn't work either. > > Just a small pebble dropped in the pond of life :) Try changing it to: find $1/ -type f | wc -l If you don't have a trailing slash on the path, find goes into stupid mode and doesn't really work.. :) -------------------------------------------------- Scott M. Stone <sstone@example.com, sstone@example.com> <sstone@example.com> Head of TurboLinux Development/Systems Administrator Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan) http://www.pht.com http://armadillo.pht.co.jp http://www.pht.co.jp http://www.turbolinux.com --------------------------------------------------------------- Next Nomikai: 20 November, 19:30 Tengu TokyoEkiMae 03-3275-3691 Next Meeting: 12 December, 12:30 Tokyo Station Yaesu central gate --------------------------------------------------------------- Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
- Follow-Ups:
 
- tlug: Re: file counting
 
- From: Jim Schweizer <schweiz@example.com>
 
- References:
 
- tlug: file counting
 
- From: Jim Schweizer <schweiz@example.com>
 Home | Main Index | Thread Index
- Prev by Date: Re: tlug: parallel-port IDE
 - Next by Date: tlug: October 10th Meeting Summary
 - Prev by thread: Re: tlug: The meeting...
 - Next by thread: tlug: Re: file counting
 - Index(es):
 
Home Page Mailing List Linux and Japan TLUG Members Links