From owner-freebsd-questions@FreeBSD.ORG Sat Nov 3 14:01:56 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1361516A41A for ; Sat, 3 Nov 2007 14:01:56 +0000 (UTC) (envelope-from m.apitz@oclcpica.org) Received: from hunter.Sisis.de (hunter.sisis.de [193.31.11.194]) by mx1.freebsd.org (Postfix) with ESMTP id 662A413C4A6 for ; Sat, 3 Nov 2007 14:01:55 +0000 (UTC) (envelope-from m.apitz@oclcpica.org) Received: (from mail@localhost) by hunter.Sisis.de (8.8.8/8.8.8) id OAA28167; Sat, 3 Nov 2007 14:25:31 +0100 (CET) (envelope-from m.apitz@oclcpica.org) Received: from ppp-82-135-67-122.dynamic.mnet-online.de(82.135.67.122) by hunter.Sisis.de via smap (V2.1) id xmaa28134; Sat, 3 Nov 07 14:25:19 +0100 Received: (from guru@localhost) by rebelion.Sisis.de (8.13.8/8.13.8/Submit) id lA3DVSju007696; Sat, 3 Nov 2007 14:31:28 +0100 (CET) (envelope-from m.apitz@oclcpica.org) X-Authentication-Warning: rebelion.Sisis.de: guru set sender to m.apitz@oclcpica.org using -f Date: Sat, 3 Nov 2007 14:31:28 +0100 From: Matthias Apitz To: White Hat Message-ID: <20071103133128.GA7665@rebelion.Sisis.de> References: <538619.51984.qm@web34408.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <538619.51984.qm@web34408.mail.mud.yahoo.com> User-Agent: Mutt/1.4.2.2i X-Operating-System: FreeBSD 6.2-RELEASE (i386) Cc: FreeBSD Users Questions Subject: Re: Determining the number of files in a directory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2007 14:01:56 -0000 El día Saturday, November 03, 2007 a las 05:27:06AM -0700, White Hat escribió: > This is probably a dumb question; however, I never let a little thing like that bother me in the past. > > Using FreeBSD-6.2 and Bash, how do I determine the number of files in a given directory? I have tried all sorts of combinations using different flags with the 'ls' command; however, none of them displays the number of files in the directory. > > Other than, by writing a script to accomplish this feat, how could I achieve my goal? $ ls | wc -l 293 matthias -- Matthias Apitz Manager Technical Support - OCLC PICA GmbH Gruenwalder Weg 28g - 82041 Oberhaching - Germany t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.oclcpica.org/ http://www.UnixArea.de/ b http://gurucubano.blogspot.com/