4 Answers
4

A range is simply an upper bound AND a lower bound. From the find spec:

expression [-a] expression

Conjunction of primaries; the AND operator is implied by the juxtaposition of two primaries or made explicit by the optional -a operator. The second expression shall not be evaluated if the first expression is false.

So all you need to do is specify both size bounds before the -delete action.

Thank you for your answer. However, as @jw013 mentioned in his comment, find conditions are logically AND'd by default. So I just added one more size condition and it worked fine! The final command looks like: find . -maxdepth 1 -size +358c -size -395c -delete
–
Eugene SApr 30 '12 at 15:15

Note that the + and - prefixes are not documented in man find, but rather in info find.
–
l0b0Apr 30 '12 at 15:21

@l0b0 Actually I can't find any reference to it in the info as well..
–
Eugene SApr 30 '12 at 15:31

+n for greater than n, -n for less than n, n for exactly n.
–
utherApr 30 '12 at 15:36

Whenever find expects a number, you can put a + sign before it to mean more than this number, or a - sign to mean less than this number. These are strict inequalities: +3 and -7 means 4, 5 or 6.

With the -size primary, you need to add the suffix c to indicate that the number is a number of bytes. You can concatenate multiple primaries to take their conjunction (in some versions, you can put -a or -and between them). Thus:

find . -size +385c -size -391c -delete

In zsh, you can use the Lglob qualifier. The default unit is bytes; like find, the characters + and - indicate strict inequalities.

rm *(L+385-391)

(The command above does not recurse into subdirectories; if you need that, add **/ before the pattern.)