From owner-freebsd-questions Tue Dec 3 7:15:15 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0AA3937B401 for ; Tue, 3 Dec 2002 07:15:14 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEDC943E4A for ; Tue, 3 Dec 2002 07:15:11 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a136.otenet.gr [212.205.215.136]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id gB3FEsNd028728; Tue, 3 Dec 2002 17:15:00 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id gB3FEmBr007231; Tue, 3 Dec 2002 17:14:48 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id gB3FEidH007230; Tue, 3 Dec 2002 17:14:44 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 3 Dec 2002 17:14:44 +0200 From: Giorgos Keramidas To: Peter Leftwich Cc: Doug Hardie , nkinkade@dsl-only.net, FreeBSD LIST Subject: Re: File Counts Message-ID: <20021203151444.GC5819@gothmog.gr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-12-02 21:26, Peter Leftwich wrote: > On Mon, 2 Dec 2002, Doug Hardie wrote: > > Thanks to all who responded. The approach below does just what I needed. > > Here's another way I don't see listed: > > $ find . -type f | wc -l > > This means "find, starting right here, all files here and in subdirectories > - then pipe the output through word count just the lines." > > You'd think FreeBSD would have a command similar to ls, df, du or a flag to > the find command such as "-countitems" or something. Nah. The Unix way of doing things is to avoid implementing "everything" in one, huge, monolithic tool and relying instead on the user to find creative ways to make many small tools work together. wc(1) already does 'counting', and it works fine in that respect. find(1) doesn't need a 'count items' option, because it's so easy to pipe the output to wc(1) and do the job. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message