A directory file has typically 4096 byte. However, I have a couple of directory files which have a size of more than 4096 bytes, e.g. 28672, 12288, 20480, 16384 (for ext4). I read this article and it says: “The initial allocation equals the size of one sector, but can grow above that if necessary. Once allocated, space is not freed if files are removed, to reduce fragmentation.” This article doesn't quote how to solve the issue. Copying to a second directory and deleting the old directory could help. But I am looking for a simple command, which clean up the directory files.
I found the answer here:
The option -D can be omitted.