Questions tagged [locate]

A command line application that shows file locations.

Locate (locate) is a command that shows file locations in the terminal. For example:

locate two would show all files with "two" in the name. The search can be narrowed using file extensions or by using grep.

128 questions
106
votes
4 answers

Determine destination location of apt-get install ?

For some applications its fairly easy enough to locate where the application was installed to using the "which" command. However, some applications such as Tomcat are a little out of my league to locate. I'm asking for particular methodology that…
Sn3akyP3t3
  • 1,636
101
votes
2 answers

How to install the locate command?

I wish to have the command locate in ubuntu 12.04 (which is used for finding files. I believe there is such a command but I cannot see it in ubuntu 12.04 Is it part of any package?
JVIyer
  • 1,011
  • 2
  • 7
  • 3
76
votes
2 answers

How to find location of installed library

Background: I'm trying to build my program but first I need to set up libraries in NetBeans. My project is using GLU and therefore I installed libglu-dev. I didn't note the location where the libraries were located and now I can't find them. I've…
Raven
  • 874
40
votes
4 answers

how to find a word in text files from a directory

Suppose that I have a directory with name _file and includes two sub directory like _1 and _2 and on each one I have some text files. I want to search a word like foo in one of these text files. How I can do that? I want to know which text files in…
35
votes
2 answers

find vs. locate

There are the commands find and locate to search for files on the disk. I know that find recursively processes all needed subdirectories to search files and therefore is slow but up-to-date, whereas locate uses a database that gets updated every now…
Byte Commander
  • 110,243
35
votes
4 answers

How do I get mlocate to only index certain directories?

I'd like to use mlocate on my Ubuntu server, but only to index certain directories (e.g. /home and /data, but not everything under /). However, mlocate's standard configuration works the opposite way; you specify the paths you want to remove (with…
29
votes
3 answers

Can't locate a directory using "locate"?

I want to locate a directory in my system using "locate" command. I know there is a directory named "bench-repo". when I'm giving the following command it shows me the following error : locate: can not stat () `/var/lib/mlocate/mlocate.db': No such…
tuxtu
  • 3,175
  • 9
  • 30
  • 44
28
votes
4 answers

Why is /var/lib/mlocate.db almost 800 MB?

Can I do something about it? I'm running out of disk space.
evencoil
  • 787
26
votes
3 answers

updatedb & locate command problem - Files from external hard drive are no longer indexed after rebooting

Files from my external hard drive are no longer indexed after rebooting. I have to remount and then run # updatedb after each reboot. The problem is updatedb takes a few minutes for my external hard drives. Is there any way I can retain indexing…
user784637
  • 11,465
25
votes
1 answer

Ubuntu 19.10: why is the "locate" command missing?

OS: Ubuntu 19.10 When I ran locate plymouth, I got dkb@dkb-uee:~$ locate plymouth Command 'locate' not found, but can be installed with: sudo apt install mlocate dkb@dkb-uee:~$ So I installed mlocate and now locate works. As far as I can…
DK Bose
  • 44,553
24
votes
3 answers

What is the difference between locate/whereis/which

What is the basic difference between locate whereis and which command. The basic difference that I observed is that locate locates all the related file names in the entire filesystem, whereas whereis and which commands only give the location…
Chinmaya B
  • 7,022
  • 7
  • 27
  • 43
19
votes
1 answer

Locate does not locate files

I have not used locate for a while and today when I look for a file that I had put away for more than a year, locate does not pick it up. I ran find to get it. It appears that none of the files in my home directory are in the index. Only files &…
eshwar
  • 808
19
votes
4 answers

How come the locate command doesn't find obvious files?

The locate command sounds intuitive. I would expect it to locate files on the filesystem. However, it rarely finds files on the system that are indeed present: $ locate ipsec.secrets This gives no results, even when run from filesystem root…
JohnMerlino
  • 7,829
17
votes
2 answers

How do I run Updatedb everyday?

How do I edit the update.conf at /etc/update.conf to run every day on Ubuntu? This would enable me to use locate with a very recent database. I read this: default setting, updatedb, it has been in /etc/cron.daily and its name is slocate.cron if you…
dearN
  • 2,209
12
votes
2 answers

How do I reduce the size of mlocate database?

I'm out of space on /var 25G 25G 0 100% /var It looks like mlocate.db is the problem: # find /var -printf '%s %p\n' | sort -nr | head 13140140032 ./lib/mlocate/mlocate.db.cgLMAM 12409839616 ./lib/mlocate/mlocate.db.MqGeqe # cat…
MountainX
  • 5,969
1
2 3
8 9