Huge directories
Doug Gwyn
gwyn at smoke.BRL.MIL
Sat Nov 26 19:41:34 AEST 1988
In article <706 at prlhp1.prl.philips.co.uk> pearmana at prlhp1.prl.philips.co.uk (Andy Pearman) writes:
>Even after most of the files in these directories disappear
>it still says "Huge directory".
>Do I have to compress the directory in some way and if so
>how do I go about doing this ??
Except on systems that perform directory compaction (rumored to be true
for 4.nBSD, n >= 2, although I've never seen it happen), UNIX directories
never shrink even though entries are "deleted" from them. A deleted
entry merely has its inumber changed to 0. The simplest way in such
circumstances to reclaim some disk storage is to make a new directory,
plant the same inode links in it (using "mv" or "ln"), then remove the
old directory and rename the new one to the original name.
By the way, you can look at the allocated size of a directory (in
blocks) by "ls -sd dir_path_name".
More information about the Comp.unix.questions
mailing list