In the
preceding example, you could also enter find / -name ???myfile??? at the shell prompt and
it would find the /home/tux/myfile file (although it will take much longer). For more
information about how to use find, enter man find at the shell prompt.
In addition to find, you can also use the locate utility to search for files. Let??™s look at this
utility next.
Using locate
The find utility works great for locating files in the file system. However, it has one drawback.
It finds files by searching through each and every directory beneath the path specified
in the command line. This process can be quite slow. For example, if you were to use
find to create a search that searched for a specific file from the top of the file system, it
may take 10 to 15 minutes (possibly longer) to complete.
As an alternative, you can use the locate utility to search for files. The locate utility operates
using an entirely different search mechanism. Instead of searching through directories,
it looks for the specified file within its own database of files that are stored in the system.
Pages:
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795