Back

Conference Topic:

The find command is really awkward and complicated, but saves a lot of time especially with the very powerful -exec option.

We had to use this command in the second assignment, and also in the midterm exam. Try to find out more about it (UNIX in a Nutshell, pp. 70-74, Das, pp. 218-223, and of course, man find), experiment with it, and, if possible, compare it with a similar facility in other operating systems that you know about.

Where do you consider it useful?

Response:

Theresa L. Ford on 03-18-2004

I think the find command was misnamed now that I've actually looked at all the options. I had thought find and locate were the same thing, merely equivalents to the basic "find file" searches under Windows. That's apparently not an accurate perception.

Locate may be close to this as a search through a database list of files, but still has regular expressions to exceed the usefulness of Windows' "find file".

Find, however, is not as much a search routine as a structured query language (SQL) equivalent for querying and manipulating the file system:

In this specific [way],
gather [things]
that match [criteria]
and do [action] with or to them.

[ways]:
from current or specific location
traverse recursively down directories or only to a specific depth
follow symbolic links or not
find in subdirectories first
find on a specific file, local, or mounted system

[things]:
files
directories
symbolic links
block or character special files
named pipes
sockets

[criteria]:
not, and, or, equal to, greater than, less than, and metacharacter support where appropriate
file name
size
created, modified, accessed time
user, group, or nonexistent user, group
permissions
number of links
inode number

[action]:
list
print
execute a command (optional 'Are you sure about this one?')
send to a device

Granted, the specific syntax is a bit like ASCII art which requires a "find expert" artist. It seems to logically use:

find [path] [ways] [things] [criteria] [action]

So if "find" was really meant to be this command's name, I have to wonder if it stands for "file inspection neutralizes deviations"? Now I'm definitely going to find more ways to use find.

------
http://unix.about.com/library/weekly/aa091100a.htm
http://www.gnu.org/software/findutils/findutils.html
http://www.gnu.org/software/findutils/manual/html_mono/find.html

Back