On 3/20/26 00:05, techlord8--- via Bug reports for the GNU find utilities wrote:
I suggest changing this:
> -empty File is empty and is either a regular file or a directory.
to this:
> -empty File is empty and is either a regular zero-byte file or a
directory with no items inside it.
Thanks for the suggestion.
I like the 'zero-byte' addition to make the description for regular files
more precise, though I am not so happy with "directory with no items inside":
First of all, I'd choose the word "entries" instead of "items" which is the
more common term for directory content, e.g. see "man readdir".
The part with "no items inside" is not true as such, because there are always
the 2 entries "." and ".." - even in a newly created or empty directory.
Therefore "directory with no entries inside" would be wrong and more confusing
than helping users I think.
Well, we could state it explicitly - yet that's quite lengthy.
-empty File is empty and is either a regular zero-byte file or a
directory with no other entries than "." and ".." inside.
FWIW: Compared to that, the man page of the BSD implementation puts it
quite short:
True if the current file or directory is empty.
Also not too bad, yet IMO missing the detail about "regular" file type,
i.e., e.g character or block device files are not considered be -empty.
Rationale: Even an empty directory reserves some space on disk, usually
one block or cluster.
I'm not sure whether the used disk space can be much related to -empty, because
the used disk space is depending on the implementation of the file system type,
and more.
E.g. 'ext4' doesn't reduce the size once the space was eaten, and an then-empty
directory still uses the max size it had.
$ df --out=fstype .
Type
ext4
$ mkdir d && cd d
$ stat -c '%s' .
4096
$ seq 500000 | xargs touch
$ stat -c '%s' .
11370496
$ seq 500000 | xargs rm
$ stat -c '%s' .
11370496
Have a nice day,
Berny