From owner-freebsd-questions@FreeBSD.ORG Thu Feb 10 23:33:27 2005 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 7184C16A4CE for ; Thu, 10 Feb 2005 23:33:27 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id E300343D48 for ; Thu, 10 Feb 2005 23:33:20 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])j1ANXANM004578; Fri, 11 Feb 2005 01:33:10 +0200 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) j1ANXBl8003942; Fri, 11 Feb 2005 01:33:11 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost)j1ANXBoY003941; Fri, 11 Feb 2005 01:33:11 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 11 Feb 2005 01:33:11 +0200 From: Giorgos Keramidas To: Chris Sechiatano Message-ID: <20050210233311.GB3861@orion.daedalusnetworks.priv> References: <20050210231719.GA24067@chris-s.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050210231719.GA24067@chris-s.com> cc: freebsd-questions@freebsd.org Subject: Re: Script Questions 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: Thu, 10 Feb 2005 23:33:27 -0000 On 2005-02-10 15:17, Chris Sechiatano wrote: > > I have a filesystem which is being used by MS workstations. People > are storing mp3's, jpgs and other 'non work related files' on here and > the management asked me to find all the files and how much space they > are using. > > I created a locate database of the filesystem so I can search that, > but the problem is it doesn't show the file sizes. I tried to pipe > the output to xargs, but that didn't work either. The file names and > paths are pretty long and there's lots of file with single quotes and > spaces that xargs does not like I guess. > > ex: > > /home/users/CRANESP1/Backup from 7-19-04/My Document's Backup 10-01-02/e-mails to save/eyetest_1.wmv > > Does anybody have anything that would work in this case? I need to do > this for about 40k files. Use -print0 (that's a zero at the end of print), and the -0 option of xargs. Then the whitespace shouldn't matter. # cd /storage/users # find . -type d -print0 | xargs -0 du -sk That should do it. - Giorgos