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 storage on the babbage system.
If you log into hopper, and run
find . -name homepage.html
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.html
You will find a match.
But it 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 search in.
Search will traverse every child directory under top level directory,
unless permissions block.
or
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 conditions