Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Centos, I have a text file in my home directory.

The command find . -size -1M doesn't show my file but find . -size -1000k does show it. This problem just seems to be happening when I use the number "1". The first command will work if I use -2M even though the file is only 500k in size.

Am I doing something wrong?

share|improve this question
1M == 1024k, not 1000k – warl0ck Oct 13 '12 at 12:14
Cheers, rookie mistake. – Lukas88 Oct 13 '12 at 22:27
up vote 6 down vote accepted

find . -size -1M will only show file of size less than 1M, that is 0M. Yes, I know, it's confusing.

find . -size 1M will show you files whose size (rounded up to the upper MiB) is 1M (so any file size from 1 to 1048576). If you want from 0 to 1048575 (< 1M), that would be:

find . -size -1048576c

If you want from 0 to 1048576 (<= 1M)

find . -size -2M


find . ! -size +1M
share|improve this answer
Thanks, I would never have figured that. – Lukas88 Oct 13 '12 at 22:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.