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

Popular posts from this blog

Accessing Windows Share (Samba) From Linux (XFCE) using Thunar

Bypassing the error by "go get" "tls: failed to verify certificate: x509: certificate signed by unknown authority"

Using phpword to merge two Mircrosoft Office Word .docx documents