If I want to use the locate command on a Linux machine, I usually run sudo updatedb first to update the database. I can run the locate command on OS X 10.5 but I can't find updatedb. What's the corresponding updatedb for the mac?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
It's sudo /usr/libexec/locate.updatedb For more information see the locate.updatedb man page. |
|||||||||||||||||
|
|
You can do |
||||
|
|
|
Personally, I just installed findutils (use MacPorts or Homebrew). Then you have GNU locate and updatedb. updatedb won't work without sudo. Personally I prefer to have a per user locatedb though; if you sudo other users will know the names/locations of all your files. I have a cron job to run:
And in my .zshrc .bashrc/.bashprofile:
|
|||
|
|
locateon an OS X box it tells you to runsudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist. – Török Gábor Feb 17 '10 at 15:24locatefor, you might find it more convenient to use the command line interface to Spotlight,mdfind, since the Spotlight database is nearly always up-to-date, and offers a lot more functionality than locate.man mdfind– Paul R Feb 17 '10 at 16:09