Page 1 of 1

'locate' not showing some files

Posted: Wed Feb 27, 2013 6:08 am
by rrand
I updated the database (using 'updatedb' as root) but I still can't find my files with 'locate' command. I know they're there. It might be because I have an encrypted home directory. (Man, I wish I never did that.) Does anyone know what I can do? I don't remember having this problem before. But now I am transferring all my important files so I can make a clean upgrade of Linux Mint. Now I need that locate command more than ever. Does anyone know what might be wrong, or a workaround?

Re: 'locate' not showing some files

Posted: Wed Feb 27, 2013 6:30 am
by xenopeek
Yes, correct. Updatedb is configured not to index files on encrypted file systems. That is configured in /etc/updatedb.conf. I wouldn't mess with that though.

Instead of locate, you can use find to search for files in your home folder. Just open a terminal and do:

Code: Select all

find ~ -iname filename
Where you replace filename with the name of the file you want to find. You can use wildcards also, so "find ~ -iname *.jpg" finds all your jpg images.

Re: Re: 'locate' not showing some files

Posted: Wed Feb 27, 2013 6:34 am
by rrand
xenopeek wrote:Yes, correct. Updatedb is configured not to index files on encrypted file systems. That is configured in /etc/updatedb.conf. I wouldn't mess with that though.

Instead of locate, you can use find to search for files in your home folder. Just open a terminal and do:

Code: Select all

find ~ -iname filename
Where you replace filename with the name of the file you want to find. You can use wildcards also, so "find ~ -iname *.jpg" finds all your jpg images.
Yeah, I guess I can use find. It will be a very slow process though. Thanks.

Re: 'locate' not showing some files

Posted: Wed Feb 27, 2013 2:49 pm
by bjornmu
Ehem. find ~ -iname *.jpg will not work if you have any files matching *.jpg in the current directory. :roll:

Always escape special characters to be used, or enclose in single quotes:

Code: Select all

find ~ -iname '*.jpg'