'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 please read how to get help
rrand
Level 1
Level 1
Posts: 8
Joined: Thu Jan 05, 2012 1:02 am

'locate' not showing some files

Postby rrand » Wed Feb 27, 2013 6:08 am

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?

User avatar
xenopeek
Level 23
Level 23
Posts: 19024
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: 'locate' not showing some files

Postby xenopeek » Wed Feb 27, 2013 6:30 am

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
Level 1
Level 1
Posts: 8
Joined: Thu Jan 05, 2012 1:02 am

Re: Re: 'locate' not showing some files

Postby rrand » Wed Feb 27, 2013 6:34 am

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: 159
Joined: Wed Dec 19, 2012 2:50 am
Location: Trondheim, Norway

Re: 'locate' not showing some files

Postby bjornmu » Wed Feb 27, 2013 2:49 pm

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'


Return to “Other topics”

Who is online

Users browsing this forum: No registered users and 12 guests