3

GNU findutils' man page for updatedb says it has a --findoptions parameter. Does it mean I can specify a find-like option there to create a specific database for locate?

Like this, to include directories only:

updatedb --findoptions='-type d' --output='/Users/me/.config/locate/locatedb-dirs'

(I tried, however, and the resulting database was exactly the same as the one without this parameter. But may be it's just my syntax that was wrong?)

4
  • try to change the --findoptions='-type f', recreate the database with updatedb and try to locate spool and see if /var/spool shows up. If so, there is a chance this findoption isn't working since it's a dir. Also, are your using locate with the -d /Users/me/.config/locate/locatedb-dirs switch to use this manual output dir of yours?
    – user34720
    Dec 12, 2018 at 19:54
  • @nwildner, OK, so I tested updatedb with and without --findoptions='-type f' on a folder with a lot subfolders / repositories (via --localpaths='/Users/me/devel'). And the result was two identical files (diff confirms). So I donno, may be we simply can't pass these options (-type d / -type f) to updatedb? :)
    – A S
    Dec 12, 2018 at 20:34
  • And, yeah, for the sake of experiment, I tried locate with -d switch pointing to this 'files-only' db, and it shows both files and folders, of course.
    – A S
    Dec 12, 2018 at 20:35
  • Maybe this thing does not work :P
    – user34720
    Dec 12, 2018 at 23:26

0

You must log in to answer this question.

Browse other questions tagged .