Reputation: 477
I've seen questions about how I can remove all files under a certain file size, but none of them have dealt with very small files (most of mine are simple .txt files that contain 500-1200 characters). All of the solutions I've seen so far look something like
find . -size -1k -delete
I've tried using the following:
find . -size -600
find . -size -600b
find . -size -0.6k
None of which worked, can someone tell me how to make this method work for smaller file sizes? (I'm sure I'm just missing a trailing character after the 600)
Upvotes: 0
Views: 86
Reputation: 881373
c
is the size specifier for bytes, it means characters. The b
variant that you may think would work is actually for blocks (of 512 bytes each).
It's all contained in detail in the manpage for find
:
-size n[cwbkMG]
File uses n units of space. The following suffixes can be used:
'b' for 512-byte blocks (this is the default if no suffix is used)
'c' for bytes
'w' for two-byte words
'k' for Kilobytes (units of 1024 bytes)
'M' for Megabytes (units of 1048576 bytes)
'G' for Gigabytes (units of 1073741824 bytes)
Upvotes: 5