
In this case, the find command returns a list of all files and folders con
-
tained in the current folder. The find command operates recursively, so it will
open all folders in the directory and all folders found within those, ad infini
-
tum. The grep command selects the file name or names in the list containing
the string “myfile.”
The foregoing command has a distinct advantage with file paths that
are broad and deep, such as /home/mike/eventcalendar/2004/May/19/ Bahamas/
Freeport/Princess/Towers.txt. By specifying “Towers.txt” instead of “myfile”
you would locate the file very quickly. Of course, Unix allows you to use the
results of a command or