Patch to find(1) to find large files.

Allyn Fratkin allyn at sdcsvax.UUCP
Sun Jun 9 15:55:32 AEST 1985


In article <1315 at hammer.UUCP>, dce at hammer.UUCP (David Elliott) writes:
> In article <663 at lsuc.UUCP> dave at lsuc.UUCP (David Sherman) writes:
> >Foo, grumble and feh! find(1) already has a "-size" option.
> 
> Put your money where your mouth is, Dave. The above note would
> imply that you can write an awk script that would generate a
> find command that looks something like this:
> 
> 	find dir \( -size n -o -size n+1 -o -size n+2 ... \)
> 
> How big can a file get?

This kind of thing is already built into find.  You say 
"find / -size +10 -print" to print the names of all files >= 10 blocks.  
The + makes it >=, not just ==.  You can also say -10 to find files <= 10
blocks.  You don't need to do all that or'ing.

Besides, if you're worried about granularity, the real fix would be to
make the -size option take a units parameter, not make -bigger take 
units.  If -size takes units, then Dave's statement is correct even if
you're worried about granularity.  (How often have you wanted that much
granularity?)

To really do things right, if you really must have -bigger, you'll
need a -smaller option too.  Of course, -size does this already.

I have to agree with dave; there's no point in having two (or three!)
options that do the same thing when one does quite nicely.

-- 
 From the virtual mind of Allyn Fratkin            allyn at UCSD.ARPA           or
                          UCSD EMU/Pascal Project  {ucbvax, decvax, ihnp4}
                          U.C. San Diego                         !sdcsvax!allyn

 "Generally you don't see that kind of behavior in a major appliance."



More information about the Comp.unix.wizards mailing list