Description of problem: find -size [<mod>]<x>M does work Version-Release number of selected component (if applicable): 4.2.27-4.1 How reproducible: compare file sizes Steps to Reproduce: 1. dd if=/bin/false of=onemeg bs=1024 count=1024 dd if=/bin/false of=onemegplus bs=1024 count=1025 dd if=/bin/false of=onemegminus bs=1024 count=1023 2. find -size 1M;find -size -1M;find -size +1M Actual results: foof@e31 m70]$ find -size 1M ./onemeg ./onemegminus [foof@e31 m70]$ find -size -1M [foof@e31 m70]$ find -size +1M ./onemegplus Expected results: [foof@e31 m70]$ find -size 1M ./onemeg [foof@e31 m70]$ find -size -1M ./onemegminus [foof@e31 m70]$ find -size +1M ./onemegplus Additional info:
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.)