A.Ellett
A.Ellett

Reputation: 373

locate does not return hits for content of `~/Library`

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?

Upvotes: 3

Views: 126

Answers (1)

Zombo
Zombo

Reputation: 1

You need to run updatedb first. Perhaps like this

updatedb --localpaths=~/Library

Upvotes: 1

Related Questions