Let's say we want to find every Clash song from their immortal album, London Calling , that is 10MB. (Yes, these were encoded at a super-high rate.) This job is easy enough with find :
$ cd Punk/Clash/1979_London_Calling $ find . -size 10M ./07_-_The_Right_Profile.ogg ./08_-_Lost_In_The_Supermarket.ogg ./09_-_Clampdown.ogg ./12_-_Death_Or_Glory.ogg
That's weird. Only four songs? Here's where you need to understand a "gotcha" associated with using find : If you say 10M , then find looks for files that are exactly 10MB in size (rounded to 10MB, of course). If you want files larger than 10MB, you need to place a plus sign ( + ) in front of the given size; if you want files smaller than 10MB, use a minus sign ( - ) in front of the size:
$ find . -size +10M ./Jimmy_Jazz.ogg ./ Lover's_Rock.ogg ./ Revolution_Rock.ogg
Now we have a problem. Specifying 10M gives us files that are exactly 10MB, excluding those that are bigger, while specifying +10M gives us files that are larger than 10MB, excluding those that are exactly 10MB. How do we get both? If you want to learn how to obtain files that are 10MB and larger, see the "Show Results If Either Expression Is True (OR)" section later in this chapter.
If you want to find large text files, use
after your number. As Table 10.1 shows,
changes the search size to bytes. Every character in a text file is
a byte, so an easy way to remember
is to associate it
with the "
For instance, to find
$ find /home/scott/documents -size +500000c