From owner-freebsd-questions@FreeBSD.ORG Tue Mar 16 00:59:37 2004 Return-Path: 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 2CEC616A4CF for ; Tue, 16 Mar 2004 00:59:37 -0800 (PST) Received: from voyager.twobirds.us (c-24-18-222-18.client.comcast.net [24.18.222.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id E421043D31 for ; Tue, 16 Mar 2004 00:59:36 -0800 (PST) (envelope-from joshua@twobirds.us) Received: from joshua by voyager.twobirds.us with local (Exim 4.30; FreeBSD) id 1B3AQ1-000144-E4; Tue, 16 Mar 2004 00:59:25 -0800 Date: Tue, 16 Mar 2004 00:59:25 -0800 From: Joshua Lokken To: Dave Carrera Message-ID: <20040316085925.GA4047@voyager.swabbies.org> Mail-Followup-To: Dave Carrera , freebsd-questions@freebsd.org References: <002501c40b24$8c600e10$0301a8c0@daveslaptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002501c40b24$8c600e10$0301a8c0@daveslaptop> User-Agent: Mutt/1.4.2.1i cc: freebsd-questions@freebsd.org Subject: Re: Simple file count question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2004 08:59:37 -0000 * Dave Carrera [2004-03-15 23:02]: > Hi List, > > I know this is going to be simple but I cant find a suitable answer by > trawling the web so I ask how do I count the number of certain files in a > directory? > > So I am in my dir and want to count how many files begin with db and show me > the number. > > I hope you can help me and thank you in advance for any help you may give > > Dave C > I don't know if this is the most elegant way, but ls | grep ^db | wc -l will do it. -- Joshua I thought my people would grow tired of killing. But you were right, they see it is easier than trading. And it has its pleasures. I feel it myself. Like the hunt, but with richer rewards. -- Apella, "A Private Little War", stardate 4211.8