Home > Q&A > body text
两个空目录, 用du -h 看 一个是 4K 一个是 12K
原来乳齿~ 根据 @冰灵果 的答案测试了一下.
1
2
3
4
5
6
7
<code>rm a -fr
for (( j=339; j<341; j++));do
for
(( j=339; j<341; j++));
do
mkdir a/$j -p
mkdir
a/
$j
-p
for (( i=0; i<$j; i++));do touch a/$j/$i;done
(( i=0; i<
; i++));
touch a/
/
$i
;done
rm a/$j/*
rm a/
/*
done
</code>
天蓬老师2017-04-17 11:38:50
How to reproduce the subject’s problem
<code class="lang-bash">mkdir a
<code
class
=
"lang-bash"
>
a
ls -l # a = 4096 = 4k
#create 500 files in directory a
for (( i=0; i<500; i++));do touch a/$i;done
(( i=0; i<500; i++));
rm a/*
ls -l # a = 12288 = 12k