On Mon, Jan 29, 2001 at 01:40:59PM -0500, Rusty Minden wrote:
> Peter Wrote
> >your find command would be helpful here, but:
> 
> >find / -name "sndconfig"
> 
> >should do it (the -print directive is default).
> 
> >pete
> I thought that with find you just entered
> #find sndconfig
> This may be my error. So I need to use
> #find / -name "sndconfig"
> What does this do does it say to look for a file or directory named
> sndconfig? I. E. the / says to lookh for a file or directory and the -name
> tells it that it is the name of the file or directory and the "sndconfig"
> says to look for sndconfig?

Rusty, the find command is IMO one of the most powerful tools UNIX
(and GNU) has to offer.  The first argument to find is always the
directory to begin the search in (searching is recursive).  It then
takes options after that to tell it what to look for.

find / -name sndconfig

says to look for a file named sndconfig anywhere in the VFS (i.e., it
starts looking in root and searches recursively through all the
directories).  find will *not* stop searching if it has found a match,
but will keep going until it has checked the name of every file.

find takes a variety of options on what to test for, and runs the
first test on each file.  If the first test passes, it looks at the
next action to take, and so on.  This allows you to construct cool
things like:

find / -perm +4001 -uid 0 -exec securize {} \;

What this says in english is:

Start the search in the root directory
If the file has the setuid bit and world-executable bits set then:
If the file's owner is root then:
run the (imaginary) program "securize" on the file.

Read the find manpage - it's really a cool tool.

Micah

Reply via email to