The find(1) man page claims that the %b and %k formats for -printf return the size of the file in 512-byte and 1K-byte blocks, respectively, implying that they're merely mathematically tweaked versions of %s (size in bytes). In fact, %b and %k report the amount of disk space allocated to the file, not the size of its contents. See: http://www.gnu.org/software/findutils/manual/html_node/find_html/Size-Directives.html In addition, I inspected the source code and determined that it's using st_blocks from struct stat, which returns the amount of allocated disk space, not the size of the file's contents (but see bug 93292).
find(1) is provided by findutils
Hrm. According to find(1): %k The amount of disk space used for this file in 1K blocks (rounded up). This is different from %s/1024 if the file is a sparse file. That one at least looks fine to me...
You must be running ~arch. findutils-4.1.20-r1 doesn't word it that way. Does %b say something similar to what %k says in your version?
%b File's size in 512-byte blocks (rounded up). If that's not good enough, please provide a patch against findutils-4.2.20.
Created attachment 59503 [details, diff] find.1: Word -printf %b the same way as %k Aped from %k, which was correct
In, thanks very much. I didn't do a rev bump for this as a I don't consider a two line doc update to an ~arch package to be worth a rebuild for most people. No backporting either, 4.2.20 will be going stable just as soon as the xfs init scripts are fixed.
/me remembers the resolution thingie...