Questions tagged [locate]

locate is a command-line tool for local file search using a database.

locate is a command-line tool for local file search using a database. The database is a front compressed list of files, it is generated by locate's companion, updatedb.

It is a faster but less versatile alternative of .

There are numerous locate implementations, with mostly compatible base features:

  • locate - from the GNU findutils
  • mlocate - The 'm' stands for "merging": updatedb reuses the existing database to avoid rereading most of the file system, which makes updatedb faster and does not trash the system caches as much.
  • rlocate - The behavior of rlocate is the same as slocate, but it also maintains a diff database that gets updated whenever a new file is created. This is accomplished with rlocate kernel module and daemon.
  • slocate - Security Enhanced version of the GNU Locate (unmaintained, site down)

Some graphical frontends also exists:

  • Catfish is a frontend for different search engines (daemons).
  • KarambaLocate is a SuperKaramba widget, a sort of GUI for shell command locate.
  • kio-locate - A KDE I/O Slave, enables to search from Konqueror.
  • KwickFind - KDE Kommander script
  • Zeloc - Zenity-Frontend for locate
  • XLocate is an X Qt4 front-end to the standard Linux locate utilities.
145 questions
47
votes
2 answers

Difference between locate and mlocate

I wanted to install the command locate, which is available via sudo apt-get installmlocate. However, I first ran sudo apt-get installlocate which seems to have installed something else. Typing the command locate however seems to call upon…
P A N
  • 1,761
  • 4
  • 19
  • 23
9
votes
2 answers

Progress bar in updatedb

Is it possible to get a reliable progress bar (or just a reliable information how long it will take) when doing updatedb?
student
  • 18,305
9
votes
3 answers

How find only executable files using 'locate'?

locate gtags would find all the files named gtags. What if I only need executables, is there any way to do this?
Jichao
  • 1,977
8
votes
1 answer

'locate' for case-insensitive words?

I wonder how to use the command locate to search for words that are not case sensitive? Such as modify locate normal to search for results that have "Normal" and "normal".
Tim
  • 101,790
7
votes
4 answers

How to locate a path?

Is it possible to locate a path in the file system like what can be done for file names? For example I want to find all paths in system that include 'foo/bar', which may have the following result: /home/myname/test/foo/bar/hello …
B Faley
  • 4,343
  • 11
  • 39
  • 48
6
votes
1 answer

Difference between mlocate and plocate

Since locate doesn't work by default in Ubuntu 22.04.1 LTS, and the message on the terminal says: Command 'locate' not found, but can be installed with: sudo apt install plocate As we can see, it says that we can install it with sudo apt install…
3
votes
2 answers

Which parts of a Linux system does locate index or not index?

I had a look at man locate but couldn't find an answer to this. The updatedb command appears to index everything under /, but according to my experiment it didn't index a file at /media/mike/W10 D drive/nonsense_file. Am I to suppose that it…
mike rodent
  • 1,132
3
votes
2 answers

Locate specific folders

I want to locate all folders on my server that end with 'wordpress-seo'. I tried find command but it takes too long. sudo find /home/w/s -type d -name 'wordpress-seo' Now I am trying locate command but it returns all paths that have…
3
votes
2 answers

locate with color

I used locate binary many time to search something on my 1TB HDD. Most of the time, I got many result and I have to read each line to get what exactly I'm looking for. It would be great if the locate can output the matched pattern with color ( just…
SHW
  • 14,786
  • 14
  • 66
  • 101
1
vote
2 answers

How to use locate with a world-unreadable home directory

man locate says: The locate database is typically built by user ``nobody'' and the locate.updatedb(8) utility skips directories which are not readable for user ``nobody'', group ``nobody'', or world. For example, if your HOME directory is not…
forthrin
  • 2,289
1
vote
2 answers

Cannot delete file, but can delete parent directory

So basically, I'm trying to delete the files: /var/lib/mysql/db/nomNomina2.* and when I look for them with locate, I get the following output: /var/lib/mysql/db/nomNomina2.MYD /var/lib/mysql/db/nomNomina2.MYI /var/lib/mysql/db/nomNomina2.frm but…
Snivs
  • 113
1
vote
1 answer

locate a file by its full file name?

When I run locate syn, it will return files with syn appearing in their file names. How can I search for files with full name syn? Is locate --regex syn$ the correct way, while locate --regex ^syn$ isn't?
Tim
  • 101,790
1
vote
1 answer

How do you inverse a "locate" command. Ex. Show everything except X

when doing a locate to find a specific file, it shows alot of stuff, but is there a way to inverse what is shown? Ex. locate anything that has the word drupal in it, but don't show anything from the home directory.
0
votes
1 answer

How can I limit locate command to search current directory?

Locate search is not limitable to current directory: I am trying to learn so I decided to write this script cd /usr/share/doc && ls -R | grep "\.html" | sudo tee htmldoclist.txt Then I want to pipe the doc list into locate command similar to…
0
votes
3 answers

locate stop repeating when a directory contains a name

Sometimes when using locate, my search string will (either incidentally or intentionally) match a portion of a directory. This causes everything below that point in the directory to be printed. For example: $ locate…
1
2