Sample Header Ad - 728x90

How to compact a directory

23 votes
2 answers
2707 views
Every so often, some application runs wild and fills a directory with a huge amount of files. Once we fix the bug and clean up the files, the directory stays big (>50MB) even though there's only 20-30 files in it. Is there some command that compacts a directory without having to recreate it? Bonus points: does a huge empty directory affect access performance of that directory? I'm assuming it does, but maybe it's not worth bothering. It seems slower to do ls on such a directory.
Asked by Mathieu Longtin (331 rep)
May 14, 2012, 01:48 PM
Last activity: Jan 31, 2022, 04:12 PM