[Ilugc] Re: apache server

  • From: vijaykumar@xxxxxxxxxxxx (Vijay Kumar)
  • Date: Fri Apr 16 15:39:11 2010

venkat raman <infoappu.linux@...> writes:

  2. what s the difference between find and locate?

Both are commands to search for files. find walks through the filesystem and
prints the files that meet a test criteria. locate searches through a database
that contains the list of files present in the system. The database is updated
by the updatedb script that is run periodically under crond.

find results are more accurate, but the program is slow, because it has to walk
through the filesystem tree. locate results are generally less accurate, because
the database might not be up-to date. If you are searching through a folder
whose contents change frequently (Ex: /home) then use find. If you are searching
through a folder whose contents do not change (Ex: /usr) then use locate.

Regards,
Vijay

Other related posts: