command-line find – What Are the File Size Options for ‘find . -size’ Command?

command linefind

I found out that to look for file size in bytes, I use 'c'.

So I can look for file size with 1000 bytes by using: find . -size 1000c

But what about different kind of size such as Mb, Gb or even bits?
What character or letters do I need to use?

Best Answer

POSIX only specifies no suffix or a c suffix. With no suffix, values are interpreted as 512-byte blocks; with a c suffix, values are interpreted as byte counts, as you’ve determined.

Some implementations support more suffixes; for example GNU find supports

  • b for 512-byte blocks
  • c for bytes
  • w for 2-byte words
  • k for kibibytes
  • M for mebibytes
  • G for gibibytes
Related Question