Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Finding a lost PYTHONPATH with find

Reply
Thread Tools

Finding a lost PYTHONPATH with find

 
 
John J. Lee
Guest
Posts: n/a
 
      05-28-2006
OK, this is really a reminder to myself next time I forget where I set
my PYTHONPATH and forget exactly how to invoke the GNU "find" command


Hope somebody else finds it useful too

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. I suppose the -maxdepth is
redundant since I think find searches breadth-first by default.

The file I was looking for turned out to be in /etc/profile.d/, whose
existence I completely forgot about...


John
 
Reply With Quote
 
 
 
 
Edward Elliott
Guest
Posts: n/a
 
      05-29-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
 
Reply With Quote
 
 
 
 
John J. Lee
Guest
Posts: n/a
 
      06-01-2006
Edward Elliott <nobody@127.0.0.1> writes:

> 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.


Yes, that's right -- thanks.


> > 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.


It can if you hit Control-C as soon as it finds the damn thing --
which is exactly what I would have done, of course.


John

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PythonPath not working with 2.2.3 on Win ME Rami A. Kishek Python 0 08-16-2003 06:54 AM
Re: Python..Tkinter..PYTHONPATH.. Steven Taschuk Python 0 07-30-2003 05:21 PM
Re: Python..Tkinter..PYTHONPATH.. klappnase Python 0 07-30-2003 10:12 AM
CGIHTTPserver looze PYTHONPATH vincent delft Python 1 07-13-2003 06:07 PM
jython and PYTHONPATH Harald Kirsch Python 1 06-29-2003 11:28 PM



Advertisments