Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2005 01:33:11 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Chris Sechiatano <chris@chris-s.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Script Questions
Message-ID:  <20050210233311.GB3861@orion.daedalusnetworks.priv>
In-Reply-To: <20050210231719.GA24067@chris-s.com>
References:  <20050210231719.GA24067@chris-s.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-02-10 15:17, Chris Sechiatano <chris@chris-s.com> 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



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