A
A
alh2018-09-07 11:01:18
linux
alh, 2018-09-07 11:01:18

How to find a file with locate command?

Hello!
Please tell me why the locate command finds files located only in the home drive, although I search from another drive and folder?
For example:
[email protected]:/media/user/F24C56834C564291/elfkkk---------$ locate Lesson
/home/user/Public/Spanish Party. Opening traps (tricks for White). Lesson 27 (part 3).mp4
/home/user/Public/Spanish part. Black's wrong moves - how to react. Lesson 08 (part 1).mp4
[email protected]:/media/user/F24C56834C564291/elfkkk---------$

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Radjah, 2018-09-07
@alh

locate searches not on the disk, but on its own database. To search the disk, there is find.

R
Rsa97, 2018-09-07
@Rsa97

locate searches not directly in the file system, but in its index file, by default /var/lib/mlocate/mlocate.db
At the same time, the actual presence of files on the disk is not checked.
Use find.

M
moropsk, 2018-09-07
@moropsk

find /media/use "Lesson*"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question