Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1818  / 2 Years ago, wed, may 11, 2022, 2:23:26

I have an Ubuntu web server running version 12.10, hosted on Digital Ocean.



When I access it using gFTP, one of the directories is listed as being over 3MB in size:



folder size



However, the directory is empty. I've tried showing hidden files and I don't see any.



Why is this folder reading as having three and a half megs of data if I can't see any files in it?


More From » server

 Answers
6

The dot file, like every directory, contains a list of names for the files in this directory and their inode numbers. So if you once had lots of files in that directory (not unlikely for a "tmp" directory) that would have made the directory entry grow to this size.



After the files are gone, the file system doesn't automatically shrink the directory file again.



You can experiment with this yourself by making a new empty directory, do ls -la in it to see the initial size (4096 on my machine) then touching a lot of files, which will make the directory size grow.



(Yes I know that I'm glossing over/being inaccurate about a lot of details here. But the OP didn't ask for a full explanation of how EXT* file systems work.)


[#21058] Thursday, May 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tialmes

Total Points: 14
Total Questions: 108
Total Answers: 102

Location: Oman
Member since Thu, Jun 16, 2022
2 Years ago
;