19 lines
715 B
HTML
19 lines
715 B
HTML
|
|
<!--# set var="title" value="Why is my directory empty and large?" -->
|
||
|
|
<!--# set var="date" value="March 2, 2006" -->
|
||
|
|
|
||
|
|
<!--# include file="include/top.html" -->
|
||
|
|
|
||
|
|
<p>This is more a curiosity question than a problem. Try this:</p>
|
||
|
|
|
||
|
|
<pre><code>mkdir temp
|
||
|
|
cd temp
|
||
|
|
seq 1 30000 | xargs touch
|
||
|
|
ls -lhd .
|
||
|
|
find . -type f | xargs rm
|
||
|
|
ls -lhd .
|
||
|
|
</code></pre>
|
||
|
|
|
||
|
|
<p>Doing this on ext3 shows a 432k directory that stays that size even after the files are removed. It appears that ext3 practices lazy deletion, leaving the directory structures intact. It probably assumes that a directory that was large once will be large again, so it can save the allocation expense in the future.</p>
|
||
|
|
|
||
|
|
<!--# include file="include/bottom.html" -->
|