find finds files.
find [-PLH] start-location[s] -test-option test-condition -action-option
Options
[-PLH] control handling of symbolic links.
-P (default), do not follow a symbolic link. Process the link file as a file.
Assume you have a homepage.html under public_html which is a symbolic link
to storge on the babbage system.
If you log into hopper, and run
find . -name homepage.htm
You should get no match.
-L Follow the link if it to a directory. Circularly linked names
If you log into hopper, and run
find -L . -name homepage.htm
You will find a match.
But can cause problems if link is circular.
Let say, on hopper, you have managed to symbolically linked dira to dir1
and dira to dir1.
You will get an error/warning :
find: `./dir1': Too many levels of symbolic links
find: `./dira': Too many levels of symbolic links
-H Follow link but only if it named as a start-location.
Start point[s] for search
start-location[s] - list of one or more top level directories
to seach in.
Search will traverse every child directory under top level directory,
unless permissions block.
unless -prune used.
If no start-location used, current directory . assumed.
If absolute path specified, absolute path will be used in result.
find $HOME -name "*.c"
will generate a list any files with a .c extension. The list will
include the absolute path.
Test condition
-test-option test-condition - determines parameter[s] to use
to recognize file of interest.
There are several other test conditions. See man find
The man page on find is one of the better man pages on the system.
It includes a whole section of examples.
Actions
-print