Using locate, updatedb, mlocate and plocate on Linux with encrypted home directory
I love using "locate" command on Linux. Finding files in a blink of an eye. Combining with "updatedb" it works amazingly fast.
I discovered that if your home directory is encrypted (or other directories are encrypted), by default locate command will not find anything in those directories.
The better solution is to build a local indexed database of your files:
updatedb -l 0 -o ~/.my_locate.db -U $HOME
And then using this database to search for files:
locate -d ~/.my_locate.db "part file name"
You may also want to edit:
cat /etc/updatedb.conf
And look at disregarded directories and filesystems: PRUNEPATHS, PRUNEFS
Comments
Post a Comment