Quote:
Originally Posted by
bakunin
I don't think so: because the size (which is a small fraction of a GB) is rounded up to the next unit (GB here, therefore 1GB) all files with 1GB and less (but at least 1c) are shown.
I hope this helps.
bakunin
Hi bakunin,
No. When no units are specified, such as with
-size 2, it is looking for a file that has a size that fits in 2 512-byte blocks which corresponds to a file with a file size that is 513 through 1024 bytes. But when units are specified, an unsigned number is looking for a file with the exact size specified (at least with a BSD-based
find utility which is also used on macOS systems). Note that the POSIX standard's
find utility's
-size primary does not include a units modifier except
c (which specifies that the number is counting bytes instead of 512-byte blocks); it just has negative numbers (meaning less than number), unsigned numbers (meaning exactly that number), and positive numbers (with a leading + meaning more than number).
If some other system's
find utility treats unit modifiers as block size multipliers instead of just numbers of bytes, that difference in behavior from BSD might be a reason why POSIX hasn't standardized modifiers other than
c.
Hi bodisha,
What operating system are you using?