Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I find that somehow the Downloads directory in /home/user/ is deleted. on using locate Downloads, it shows the existence of directory without any existence of files within.

now when I manually create directory named Downloads, locate Downloads shows the directory as well as the files the original folder had.

also there is no hidden Downloads folder nor can I access the folder or its files

this behavior is quite unexpected.

share|improve this question

1 Answer 1

locate command does not use the filesystem directly, it uses a database which is updated periodically by a background process:

locate reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs to standard output, one per line. ...

By default, locate does not check whether files found in database still exist. locate can never report files created after the most recent update of the relevant database.

So I guess this is an artifact of the actual filesystem state and what locate thinks of the filesystem being out of sync.

To search the filesystem directly you can use find command.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.