Finding a lost PYTHONPATH with find

Edward Elliott nobody at 127.0.0.1
Mon May 29 14:18:46 EDT 2006


John J. Lee wrote:

> find / -maxdepth 3 -size -100k -type f -exec grep -sli pythonpath '{}' \;
> 
> 
> The minus in '-100k' (meaning "less than 100k") seems to be
> undocumented, at least on my system.  

It should be standard in linux man pages, can't speak for other unices:

   TESTS
       Numeric arguments can be specified as

       +n     for greater than n,

       -n     for less than n,

       n      for exactly n.

Maybe you were fooled because it's not directly under the description of
-size.


> I suppose the -maxdepth is 
> redundant since I think find searches breadth-first by default.

??? maxdepth determines how deep the search will look, not the order the
search occurs.  Your search only find things within 3 levels of the root,
unless your directory tree goes no deeper than that (very unlikely) the
maxdepth can't be redundant.

-- 
Edward Elliott
UC Berkeley School of Law (Boalt Hall)
complangpython at eddeye dot net



More information about the Python-list mailing list