'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

'locate' not showing some files

Postby rrand on 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?
rrand
Level 1
Level 1
 
Posts: 10
Joined: Thu Jan 05, 2012 1:02 am

Linux Mint is funded by ads and donations.
 

Re: 'locate' not showing some files

Postby xenopeek on 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.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15273
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Re: 'locate' not showing some files

Postby rrand on 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.
rrand
Level 1
Level 1
 
Posts: 10
Joined: Thu Jan 05, 2012 1:02 am

Re: 'locate' not showing some files

Postby bjornmu on 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'
User avatar
bjornmu
Level 3
Level 3
 
Posts: 160
Joined: Wed Dec 19, 2012 2:50 am
Location: Trondheim, Norway


Return to Other topics

Who is online

Users browsing this forum: No registered users and 4 guests