Date: Thu, 9 Dec 1999 17:05:57 -0600 From: Dan Nelson <dnelson@emsphone.com> To: Zhihui Zhang <zzhang@cs.binghamton.edu> Cc: Ben Smithurst <ben@scientia.demon.co.uk>, cjclark@home.com, freebsd-questions@FreeBSD.ORG Subject: Re: hopefully three simple questions Message-ID: <19991209170557.A7362@dan.emsphone.com> In-Reply-To: <Pine.GSO.3.96.991209164209.6822A-100000@sol.cs.binghamton.edu>; from "Zhihui Zhang" on Thu Dec 9 16:44:10 GMT 1999 References: <19991209201115.B1271@strontium.scientia.demon.co.uk> <Pine.GSO.3.96.991209164209.6822A-100000@sol.cs.binghamton.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Dec 09), Zhihui Zhang said:
> On Thu, 9 Dec 1999, Ben Smithurst wrote:
> > Crist J. Clark wrote:
> > > Zhihui Zhang wrote,
> > >
> > >> (2) How to find the largest directory in a filesystem? I mean
> > >> the one with the maximum number of files in it.
>
> I have found a solution (hopefully correct):
>
> # find / -type d -ls | awd '{print $2, $11}' | sort -n | tail
>
> -Zhihui
The "size" of the directory printed by 'find' does not always indicate
how many files are in it. If you fill a directory with files and then
delete every other file, it won't be able to compact out the empty
slots. You'll have to walk the entire directory tree and count the
files in each subdirectory, I'm afraid.
--
Dan Nelson
dnelson@emsphone.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991209170557.A7362>
