Question

I've got an iMac and I'm trying to find a file which is buried deep within my Library folder. Thinking I could find it quick and easily using locate from command prompt, I was surprised that my file was not found. I wound up using find instead.

Does anyone know how to get locate's data base to include content within my ~/Library directory?

I suspect this may be a result of Mac making ~/Library a hidden directory. (While it's not hidden on the command line, it is hidden in Finder.) So I guess I'm asking for two possible things:

  1. How can I get the locate database to include content from ~/Library but not every hidden directory?
  2. How can I get the locate database to include hidden directories?
Was it helpful?

Solution

You need to run updatedb first. Perhaps like this

updatedb --localpaths=~/Library
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top