I'm trying to find all the files in /tmp/ that less than 1MB.

mkdir /tmp/scott
cd /tmp/scott
echo "Hello world" > test.txt
find . -size -1M -type f    # doesn't work
find . -size -2M -type f    # works
find . -size -1024k -type f # works

From what I can tell doing -size -1[kMG] doesn't output any files? It's pretty easy to use a non-one number with size but it's a footgun that it doesn't work like the user would expect.


Reply via email to