find is a very powerful command. After the last post about grep,
in which I mentioned that DOS has a command called “find” which
is a simplistic version of grep, I now feel obliged to tell all
about the real (that is, the *nix) Find works on the basis of
find (from somewhere) (something); the “from somewhere” is often
“.” (here, the current directory), or “/” (root, to search the
entire filesystem). it’s not terribly interesting. What is
interesting, is the “something” bit. You can specify a file
name, for example: $ find / -name "foo.txt"
/home/steve/misc/foo.txt $ That wasn’t very exciting, and it
will take a long time to complete, too. Systems with “slocate”
installed could just say locate foo.txt and get the answer back
in a fraction of a second (by looking it up in a database)
,without trawling through the whole hard disk (or, indeed, all
attached disks). So that’s not what’s exciting about find. What
is exciting about find, is what else it can do, instead of just
“-name foo.txt”. Don’t get me wrong; the