Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size filter seems to be inconsistent with find #584

Closed
codyro opened this issue May 6, 2020 · 4 comments
Closed

Size filter seems to be inconsistent with find #584

codyro opened this issue May 6, 2020 · 4 comments

Comments

@codyro
Copy link

codyro commented May 6, 2020

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

Distributor ID: CloudLinux
Description:    CloudLinux release 7.8 (Alexei Leonov) 
Release:        7.8
Codename:       AlexeiLeonov```
@codyro codyro added the bug label May 6, 2020
@lhhong
Copy link

lhhong commented May 9, 2020

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?

@codyro
Copy link
Author

codyro commented May 11, 2020

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.

@sharkdp sharkdp added this to the 8.1 milestone May 19, 2020
@sharkdp
Copy link
Owner

sharkdp commented May 19, 2020

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)

@sharkdp
Copy link
Owner

sharkdp commented May 19, 2020

Released in fd 8.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants