Public bug reported: If I have a file of size less than 1k, and use: find -size -1k to try to find it, it doesn't. If I use find -size -1000c it does find it. If I use find -size -2k to find it, it does. It seems like the parsing of units is wrong when you use 'k' for the size units.
$ ls -l testf* -rw-rw---- 1 luke kendall 1071 Oct 26 17:06 testf -rw-rw---- 1 luke kendall 803 Oct 26 17:07 testf2 -rw-rw---- 1 luke kendall 963 Oct 26 17:07 testf3 $ find testf3 -size -1k -print $ find testf3 -size -2k -print testf3 $ find testf -size -2k -print $ find testf -size -3k -print testf $ find --version find (GNU findutils) 4.4.2 Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Eric B. Decker, James Youngman, and Kevin Dalley. Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS() CBO(level=0) $ lsb_release -rd Description: Ubuntu 14.04.1 LTS Release: 14.04 Package name is findutils I expected find -size -Nk to list a file if it is smaller than N kb. Instead, the file is only listed if it is smaller than (N+1) kb. ** Affects: findutils (Ubuntu) Importance: Undecided Status: New ** Attachment added: "Three ultra-simple test files" https://bugs.launchpad.net/bugs/1385813/+attachment/4245080/+files/test-files.zip -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1385813 Title: find -size -Nk seems to be off by 1 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/findutils/+bug/1385813/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs