Mac ::: Using locate
Posted by: fidel in Terminal, mac, tags: 10.4, 10.5, cli, commandline, cronnix, find, locate, man page, terminal, updatedb, whereisI must admit, i really like the locate command.
Unfortunally the database is usually out of date if you need it…so here the easy way how to update it
- Open Terminal.app
- Enter: sudo /usr/libexec/locate.updatedb
Guess it would make sense to create a cron-job or similar for this update-procedure
Haven’t tested this on 10.4 but i bet its the same commands. Otherwise should the man-page in 10.4 solve this question (man locate)
About locate itself:
locate = find data files, programs, directories, & objects matching your search.
For example, let’s say I’m searching for a file with the word “license” in the filename:
locate license
Since you usually receive quite a long list when running locate, you’ll probably want to do this:
locate license | more
-or-
locate license | less
Note that locate searches by name only. To search by any other attribute, use find. To search only for commands, use whereis.






Entries (RSS)