Okay, but this works: for x in `find . -name \* -print`; do echo "$x"; cat $x | wc -l; done
Ben ----- Original Message ----- From: "Gordon Messmer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, July 12, 2003 10:23 PM Subject: Re: recursive word count (wc) > fred smith wrote: > > On Fri, Jul 11, 2003 at 11:51:22AM -0400, Reuben D. Budiardja wrote: > > > >>Hello, > >>Just a quick question, wondering if somone can help. How do I do recursive > >>word / line count using 'wc'? What I mean, eg if I have 3 directories in the > >>current directory, I want wc to go inside each directory, cound the line / > >>words for all the files in each directory, and display the total of the files > >>in those 3 different directories. > >> > >>Any help ? > > > > > > Off the top of my head: > > > > wc -w `find . -name \* -print` > > ...which will fail if there are too many files for the command line. > > > > -- > redhat-list mailing list > unsubscribe mailto:[EMAIL PROTECTED] > https://www.redhat.com/mailman/listinfo/redhat-list > -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list