Bug 246122
Summary: | find -size does not work properly with 'M' unit | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | ladislav <ladislav> |
Component: | findutils | Assignee: | Vitezslav Crhonek <vcrhonek> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 5.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2007-09-25 14:15:11 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
ladislav
2007-06-28 17:29:38 UTC
This behaviour is correct, see the documentation: http://www.gnu.org/software/findutils/manual/html_mono/find.html.gz#Size "True if the file uses n units of space, rounding up.". _Rounding up_! In the package man page (including lates version) this sentence is a bit different "File uses n units of space.". Try report bug to upstream. With 1M, onemegminus is round to 1M, that's the reason, why find -size 1M both files are returned. If you try your example with find {+,-, }1024k, you get what you expect. Maybe this will help you understand: [vcrhonek@norcus tmp]$ ls -alh total 29M drwxr-xr-x 2 vcrhonek vcrhonek 4.0K Sep 25 15:47 . drwx------ 82 vcrhonek vcrhonek 4.0K Sep 25 14:23 .. -rw-rw-r-- 1 vcrhonek vcrhonek 5.0M Sep 25 15:41 fivemeg -rw-rw-r-- 1 vcrhonek vcrhonek 4.0M Sep 25 15:45 fourmeg -rw-rw-r-- 1 vcrhonek vcrhonek 7.0M Sep 25 15:44 sevenmeg -rw-rw-r-- 1 vcrhonek vcrhonek 6.0M Sep 25 15:44 sixmeg -rw-rw-r-- 1 vcrhonek vcrhonek 3.5M Sep 25 15:47 threeandhalf -rw-rw-r-- 1 vcrhonek vcrhonek 3.0M Sep 25 15:44 threemeg [vcrhonek@norcus tmp]$ find -size 5M ./fivemeg [vcrhonek@norcus tmp]$ find -size 4M ./fourmeg ./threeandhalf [vcrhonek@norcus tmp]$ find -size -4M ./threemeg Thanks for pointing out the rounding up. Very counter intuitive and twisted imnsho, but as you point out, correct behavior per the man page. (Compare with same in k units for example.) |