Linux.com

Re:Do not forget Locate or (r)grep

Posted by: Administrator on July 26, 2005 04:34 AM
locate/slocate require you to build a database of information before you can use them. Most distro's have an "updatedb" command which must be run as root before locate will work.
NB -- If your distro includes/installs locate, it will most likely put updatedb into a cron job and run it for you, every night. This is fine on a desktop where files constantly come and go, but if you run a server with a ton of files, updatedb can bring your system to a screeching halt everynight for as long as it takes to run. In production environments, updatedb's cron job is best disabled, and updatedb run only when needed. At the very least, learn what the '-e' flag does to (GNU) updatedb.

#

Return to CLI Magic: Information, please