[lug] find command or similar

Hugh Brown hugh at math.byu.edu
Tue May 13 12:13:47 MDT 2003


On Tue, 2003-05-13 at 14:02, Tkil wrote:
> >>>>> "Stephen" == Stephen G. <boulderlug at max-uptime.com> writes:
> 
> Stephen> More then 200 characters but less than say 240?
> 
> >>>>> "Ed" == Ed Hill <ed at eh3.com> writes:
> 
> Ed> find . -name '*' -depth -printf "%f\n" | egrep '.{201,239}'
> 
> ITYM:
> 
>    egrep '^.{201,239}$'
> 
> Otherwise, lines over 240 will still match.
> 
> Also, instead of
> 
>    -printf "%f\n"
> 
> You can just use
> 
>    -print
> 

if you use print, then you get the whole path starting from ./ and egrep
will count the number of the chars in the path instead of just the
filename.

if you use print, you can use egrep ".*/.{201,239}$" and have it count
correctly and give you the full path name and not match more than it
should.


also out of curiosity, why use -name '*' instead of -type f


> Out of curiosity, why are you using "-depth"?
> 
> t.
> 





More information about the LUG mailing list