linux - Find fails to find files below 1M but works fine with 'k' units -
i have created file named 1.txt , 9kb in size:
stat 1.txt file: `1.txt' size: 9322 blocks: 24 io block: 4096 regular file access: (0600/-rw-------) uid: ( 0/ root) gid: ( 0/ root) access: 2015-06-26 10:12:47.000000000 +0100 modify: 2015-06-26 10:12:47.000000000 +0100 change: 2015-06-26 10:12:47.000000000 +0100
when run find
command option -size -100k
k units, file found:
#find . -type f -size -100k #./1.txt
when use m
units , -size -10m
file still found:
#find . -type f -size -10m #./1.txt
but when try find files less 1m in size, find
doesnt find file:
#find . -type f -size -1m #
and yes, version of find (find (gnu findutils) 4.4.0
) supports m
unit.
i believe because units represented integers, , "less 1" 0, searches files 0megs in size.
counter intuitive sure, retained backward compatibility distant past.
Comments
Post a Comment