LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Empty directory taking up space (https://www.linuxquestions.org/questions/linux-newbie-8/empty-directory-taking-up-space-4175475040/)

anon091 08-28-2013 10:47 AM

Empty directory taking up space
 
So when you clear out a directory that contained a lot of files, or was frequently used, it seems that the . inside of it doesn't go back to 4k in size most empty folders show as, it's in the hundreds of kb's range. Why is that? Not a big deal but i'm just curious, is it logging something from files that were previously in there?

ll -ah
total 360K
drwxrwx--- 2 txt text 352K Aug 28 06:46 .
drwxrwx--- 9 txt text 4.0K May 24 2011 ..

eSelix 08-28-2013 04:18 PM

This is size of metadata for this directory. It is not deallocated after removing directory entries (ex. files), due too many work to do for this and very small amount of data wasted, it is just not necessary (writing to disk cost, so also data of removed files is not overwritten but only few bytes of it metadata). Anyway it will be used again when you create new entries or removed if you delete directory.

anon091 08-28-2013 04:24 PM

Thanks. I was just curious at which point it would free that space, or why it held on to it. thanks.


All times are GMT -5. The time now is 11:33 PM.