'locate' not showing some files

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
rrand

'locate' not showing some files

Post 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?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29560
Joined: Wed Jul 06, 2011 3:58 am

Re: 'locate' not showing some files

Post 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.
Image
rrand

Re: Re: 'locate' not showing some files

Post 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.
User avatar
bjornmu
Level 3
Level 3
Posts: 189
Joined: Wed Dec 19, 2012 2:50 am
Location: Trondheim, Norway

Re: 'locate' not showing some files

Post 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'
Locked

Return to “Other topics”