Fd: Size filter seems to be inconsistent with find

Created on 7 May 2020  路  4Comments  路  Source: sharkdp/fd

Describe the bug you encountered:
When using fd with the --size option I'm getting inconsistent results compared to find.

[root@codyrtest ~]# fd -S +100M . /home/testfd -X du -h
<snip>
97M     /home/testfd/backup_2020-04-12-0015f43a72d0ad58-uploads.zip
97M     /home/testfd/backup_2020-04-19-0017d6dfe64274e8-uploads.zip
97M     /home/testfd/backup_2020-05-03-0014c8864f2fcc91-uploads.zip
97M     /home/testfd/backup_2020-04-05-0018fcdb62056a62-uploads.zip
97M     /home/testfd/backup_2020-04-26-0032b7f351a070a3-uploads.zip
99M     /home/testfd/website_misc.zip
</snip>

find does not report these files.

Describe what you expected to happen:
Files 100M+ would be listed and printed

What version of fd are you using?
fd 7.4.0

Which operating system / distribution are you on?
Linux 3.10.0-962.3.2.lve1.5.26.2.el7.x86_64 x86_64

LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CloudLinux Description: CloudLinux release 7.8 (Alexei Leonov) Release: 7.8 Codename: AlexeiLeonov

documentation question

Most helpful comment

M is for SI unit = 1,000,000 bytes. To get the same output as find, you will need to use Mi (Mebibyte) which is 1024 * 1024 bytes. Perhaps documentation could be clearer since most people are used to M as Mebibytes?

All 4 comments

M is for SI unit = 1,000,000 bytes. To get the same output as find, you will need to use Mi (Mebibyte) which is 1024 * 1024 bytes. Perhaps documentation could be clearer since most people are used to M as Mebibytes?

That was it. Sorry for the mistaken bug report -- I see @sharkdp added a documentation tag. I think it'd make sense to update the documentation to be more clear in regards to the filesize filters.

I have tried to improve the documentation with this respect.

since most people are used to M as Mebibytes?

Maybe they are (and historically, that might have been used), but that's definitely not what the standard has to say (SI, IEC, https://en.wikipedia.org/wiki/Kibibyte)

Released in fd 8.1.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blueray453 picture blueray453  路  3Comments

matu3ba picture matu3ba  路  4Comments

Dietr1ch picture Dietr1ch  路  3Comments

mwgkgk picture mwgkgk  路  3Comments

mathomp4 picture mathomp4  路  4Comments