Today I found an "empty" directory with a size of 4MB.
It had no visible contents, so I tried ls -lah
. This showed me some hidden files (not very large). Searching for the reason why the directory was so large I found that the dot file (.
) had a size of 3.9MB.
What gets stored in that file? Isn't that just a kind of link to the same directory?
Here is the shell output (anonymized):
-bash# more /proc/version
Linux version 2.6.18-8.1.15.el5 (mockbuild@builder6.centos.org) (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP Mon Oct 22 08:32:04 EDT 2007
-bash# pwd
/data/foo/bar/tmp
-bash# ls -lah
total 4.1M
drwxrwxrwx 3 nobody nobody 3.9M Nov 21 10:02 .
drwxrwxrwx 16 nobody nobody 4.0K Aug 27 17:26 ..
-rw------- 1 root root 20K Oct 25 14:06 .bash_history
...
e2fsck -D
on the filesystem, but that requires it be unmounted. – psusi Nov 21 '12 at 19:52debugfs
may be insightful – Volker Siegel Jul 20 '14 at 05:56