find syntax

find syntax

Post by Matthew Vanece » Sat, 22 Nov 1997 04:00:00



Can someone tell me the exact syntax for using find?  I've tried

find -depth <string>

and it doesn't work.  The man page, unfortunately, doesn't give an
example.  If I wanted to find "money" in the /bank directory tree (which
is not in the locatedb), how would I do it?

--
Matthew Vanecek
For professional Website hosting services, visit http://www.mjv.com
Studies in Business Computers at SAC, San Antonio, TX
Visit my Website at http://lonestar.texas.net/~vanec

For 93 million miles, there is nothing between the sun and my shadow
except me. I'm always getting in the way of something...

 
 
 

find syntax

Post by Frank Sweetse » Sat, 22 Nov 1997 04:00:00



> Can someone tell me the exact syntax for using find?  I've tried

> find -depth <string>

> and it doesn't work.  The man page, unfortunately, doesn't give an
> example.  If I wanted to find "money" in the /bank directory tree (which
> is not in the locatedb), how would I do it?

simplest synax:

find <dir> -name filename -print

        where <dir> is the directory you want to start searching in, and
filename is the name of the file you're looking for.  if you use wildcards,
you have to quote them, ie -name '*.ps'

--
Frank Sweetser rasmusin at wpi.edu fsweetser at blee.net | PGP key available
paramount.res.wpi.net RedHat 4.9.1 Linux 2.0.32   i586   | at public servers
Woody: Hey, Mr. Peterson, what's the story?
Norm:  Boy meets beer.  Boy drinks beer.  Boy gets another beer.
                -- Cheers, The Proposal

 
 
 

find syntax

Post by Frank Sweetse » Sun, 23 Nov 1997 04:00:00




> >simplest synax:

> >find <dir> -name filename -print

> It seems that when I simply type:
>    find -name filename
> it returns the same results as the longer syntax above (defaulting the
> search from the current directory and printing the results to the terminal).

> I'm using GNU find 4.1.  Is this shortcut syntax specific to the version of
> find I'm using, or can I actually end up with unexpected results with the
> syntax I'm using?

This syntax works fine for GNU find - however, other versions don't supply
the defaults, so you could get find going off and finding all the files you
told it to - and not even telling you, for example :-)

--
Frank Sweetser rasmusin at wpi.edu fsweetser at blee.net | PGP key available
paramount.res.wpi.net RedHat 4.9.1 Linux 2.0.32   i586   | at public servers
Coach: How's life treating you, Norm?
Norm:  Like it caught me in bed with his wife.
                -- Cheers, Any Friend of Diane's

 
 
 

find syntax

Post by Jin » Sun, 23 Nov 1997 04:00:00



Quote:

>simplest synax:

>find <dir> -name filename -print

It seems that when I simply type:
        find -name filename
it returns the same results as the longer syntax above (defaulting the
search from the current directory and printing the results to the terminal).

I'm using GNU find 4.1.  Is this shortcut syntax specific to the version of
find I'm using, or can I actually end up with unexpected results with the
syntax I'm using?

--
- Jint <jint at gte dot net>
Please be sure to fix the reply-to
address when replying via email.