From owner-freebsd-questions@FreeBSD.ORG Fri Feb 11 16:35:55 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 E047916A4CE for ; Fri, 11 Feb 2005 16:35:55 +0000 (GMT) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 861A043D31 for ; Fri, 11 Feb 2005 16:35:55 +0000 (GMT) (envelope-from nkinkade@fastmail.fm) Received: from frontend2.messagingengine.com (frontend2.internal [10.202.2.151]) by frontend1.messagingengine.com (Postfix) with ESMTP id 06898C55561; Fri, 11 Feb 2005 11:35:54 -0500 (EST) X-Sasl-enc: 9j7wHhFdr5popPlG13LDiQ 1108139748 Received: from gentoo-npk.bmp.ub (unknown [206.27.244.136]) by www.fastmail.fm (Postfix) with ESMTP id E8ABD570326; Fri, 11 Feb 2005 11:35:48 -0500 (EST) Received: from nkinkade by gentoo-npk.bmp.ub with local (Exim 4.21) id 1Czdlm-0001Ht-JR; Fri, 11 Feb 2005 10:35:50 -0600 Date: Fri, 11 Feb 2005 10:35:50 -0600 From: Nathan Kinkade To: Chris Sechiatano Message-ID: <20050211163550.GI8365@gentoo-npk.bmp.ub> Mail-Followup-To: Chris Sechiatano , freebsd-questions@freebsd.org References: <20050210231719.GA24067@chris-s.com> <20050210233311.GB3861@orion.daedalusnetworks.priv> <20050211002434.GC24067@chris-s.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IRIOLc8eTv1AOxGv" Content-Disposition: inline In-Reply-To: <20050211002434.GC24067@chris-s.com> X-PGP-Fingerprint: 3FDF A406 B149 3959 A8CB C5A9 3B46 4812 D852 7E49 User-Agent: Mutt/1.5.6i Sender: cc: freebsd-questions@freebsd.org Subject: Re: Script Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Nathan Kinkade List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2005 16:35:56 -0000 --IRIOLc8eTv1AOxGv Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 10, 2005 at 04:24:34PM -0800, Chris Sechiatano wrote: > > Use -print0 (that's a zero at the end of print), and the -0 option of > > xargs. Then the whitespace shouldn't matter. > >=20 > > # cd /storage/users > > # find . -type d -print0 | xargs -0 du -sk > >=20 > > That should do it. > >=20 > > - Giorgos > > This is close to what I was trying before. Is there a way I can pipe the > output of locate into xargs? The filesystem is 680 Gigs and I'd like to > only search it once if possible. >=20 > This doesn't work: >=20 > # slocate -i -d /tmp/04vfile001_db *.wmv | xargs -0 ls -l How about using differnt tools altogether? If you are not concerned with lots of little files, but mostly worried about lots of large files then how about using a mixture of find(1) and du(1)? You can pass a -size argument to find that will only give you files greater than a certain size, for example: # find /home/users -size +10240k > big_files This should find every file that exceeds approx. 10MB in size and dump the output to file for later parsing. Or if you are concerned with the overall size of a particular group of directories (perhaps those of users) something like this should work: # find /home/users -type d -maxdepth 1 | xargs du -sh Nathan --IRIOLc8eTv1AOxGv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFCDN7mO0ZIEthSfkkRAiBKAKDdVYbLIM5zoy5Rf3/a9gARAgzgvwCglGal DvnBL++Mc/QufQdwT89vCi4= =CfpN -----END PGP SIGNATURE----- --IRIOLc8eTv1AOxGv--