Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2005 10:35:50 -0600
From:      Nathan Kinkade <nkinkade@ub.edu.bz>
To:        Chris Sechiatano <chris@chris-s.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Script Questions
Message-ID:  <20050211163550.GI8365@gentoo-npk.bmp.ub>
In-Reply-To: <20050211002434.GC24067@chris-s.com>
References:  <20050210231719.GA24067@chris-s.com> <20050210233311.GB3861@orion.daedalusnetworks.priv> <20050211002434.GC24067@chris-s.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050211163550.GI8365>