Re: Find Question



On 2009-01-19, George <me@xxxxxx> wrote:

I want to write a find command that looks only in certain subdirectories
of a certain directory - say we have foo as the top-level directory and
foo1, foo2 as subdirectories. I want my command to look into files in foo
and foo1, but not foo2.

If I write (when the current directory is foo) find . -type f -prune this
will not look in foo1, which is something I want to happen.

A look at the documentation didn't produce any results.

Look into the '-path' variable. Maybe '--path'

Can't remember the exact syntax and don't have my notes here. But try
something like this:

find foo/ -path 'foo1' -type f -iname "myfile*" ...

That would start looking in foo, for any subdir foo1, containing files
starting with "myfile", case insensitive.


Hope that might set you on the right track.

--
Elevators smell different to midgets
.



Relevant Pages

  • Re: Find Question
    ... foo1, foo2 as subdirectories. ... foo and foo1, but not foo2. ... This happens across subdirectories and I might need to exclude many of them for various reasons every time, so I need them all in my search path. ...
    (comp.unix.shell)
  • mail relay
    ... foo and foo1 sit in office A, ... when foo sends mail to foo1, sendmail on G sees it as local mail ... When foo or foo1 wants to send it to foo2, I need my mail relay to ...
    (comp.mail.sendmail)
  • Re: Find Question
    ... foo1, foo2 as subdirectories. ... foo and foo1, but not foo2. ...
    (comp.unix.shell)
  • Re: Find Question
    ... foo1, foo2 as subdirectories. ... I want my command to look into files in foo ...
    (comp.unix.shell)
  • Re: Trouble with updating reference variables through method calls
    ... Why is foo1 updated in updateFoo but not in main? ... Foo foo = new Foo; ... connection with whatever the method's caller provided as an argument. ... (I've talked about method parameters here; for completeness I should ...
    (comp.lang.java.help)