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

learn more… | top users | synonyms

5
votes
1answer
48 views

Is there a way to have Nautilus include mlocate in the results?

When searching for files, I often prefer using locate (because of the speed). However, I end up opening a terminal just for that purpose and then closing it again. Not a big problem for me, but my ...
3
votes
1answer
873 views

How to update linux “locate” cache

How can i update the cache / index of locate? I installed new packages and the files are clearly not yet indexed. So which command do I have to ommit, in order for the indexer to trigger. I'm ...
0
votes
1answer
30 views

How do I tell which php.ini I am using after doing a 'locate php.ini'?

I'm currently running CentOS and also have cpanel installed. I have root access to the server. When I do a 'locate php.ini', I get a page full of results. Is there a way to find out which php.ini ...
1
vote
1answer
25 views

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 ...
2
votes
2answers
90 views

How to add specific directories to “updateb” (locate) search path?

I keep my digital music and digital photos in directories in a Windows partition, mounted at /media/win_c on my dual-boot box. I'd like to include those directories—but only those directories—in the ...
2
votes
1answer
33 views

How do I search files without certain extensions in their names?

I would like to search recursively in all the files and directories under a directory for some strings e.g. library. I also would like to exclude files and directories which store downloaded ...
1
vote
2answers
51 views

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 ...
0
votes
0answers
14 views

Using regex in locate [duplicate]

I would like to search for both words pdf and hack in all filenames and their paths. The order of the two words doesn't matter. I use the command locate with a regex pattern: locate --regex ...
1
vote
4answers
328 views

Alternative for “locate” on debian

I often use "locate" command on CentOs to find files. What's the alternative for this command on Debian ?
1
vote
2answers
51 views

How to locate a file in a directory

How can I locate a file using locate in CentOS under a specific directory from terminal? Locate search the whole database!
5
votes
4answers
653 views

How can I use locate only for a directory

This finds a large number of files that are under various subdirectories of "Dropnot" $ locate Dropnot Can I find just the directory location with locate? (which directory "Dropnot" is in) So if ...
1
vote
4answers
275 views

regex matching with “locate”

I'm trying to use the locate command to find files in my home folder, however whenever I try and run this I get no results: locate -i -l 4 --regexp '^\/home\/jack\/[A-Za-z0-9\/\ ]*(My.)*$' I've ...
3
votes
1answer
89 views

GTK Frontend for locate

I am a heavy user of the locate tool, which is part of the findutils package. It's fine to use it on command line, but sometimes I would also like to search for a file (as fast as with locate) within ...
4
votes
4answers
238 views

Locating files and displaying their owner

I have to search for a specific file type on a storage unit and also want to know their owners. With locate '*.txt' >> result.txt I find all files I'm looking for but I'm missing the owner this ...
2
votes
1answer
486 views

why updatedb command takes too much time?

I have read that to run locate command on CYGWIN first I need to run the following command. updatedb --localpaths=c:/ what this command exactly do as I run this on CYGWIN and it is taking too much ...
2
votes
2answers
47 views

How to display size of each file next to it after executing the “locate” command?

Is there anyway to display the size of each file next to it after executing the "locate" command?
2
votes
2answers
58 views

Keep only first match from locate output

I need to locate a library on my system and it's name is expected to be found a couple of times. I want to keep only the first occurrence. So far I've tried some methods for splitting strings by ...
32
votes
3answers
6k views

locate vs find: usage, pros and cons of each other

In Linux and Unix systems there are two common search commands: locate and find. What are the pros and cons of each? When one have benefits over the other?
2
votes
1answer
81 views

is there a web app for returning results to a search on an indexed database?

I would very much like to allow users in a small office environment harness the power of slocate indexed database on the file server. Currently when users are looking for a file in our fileserver, ...
2
votes
1answer
681 views

'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".
3
votes
3answers
616 views

How to monitor directory/file changes to rebuild index?

Just moved to Ubuntu 12.04 from Windows 7. Under Win 7 I use "Everything" to search files and directories, it can build the index database and update it once any file or directory changes. I'm very ...
4
votes
2answers
467 views

No locate.db even after running updatedb

Any clue what's up with this? djc@miles rebar $ sudo updatedb djc@miles rebar $ locate .dialyzer_plt locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory djc@miles rebar $ ...
1
vote
1answer
2k views

updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'

I go to use the updatedb command to update the index and I get updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db' fyi The locate command is working, e.g. $ locate Index.xml ...
0
votes
0answers
230 views

Installing mlocate on mac OS 10.7

I'm a beginner in using Linux. I'm trying to use the command "locate". Once I use this command, I get an error that says the locate database should be created. I used the command below to create that ...
1
vote
2answers
105 views

Why don't find and locate search /bin?

What gives? Normal find and locate commands don't turn up the verify program that lives at /bin/verify. In fact, it seems they don't turn up anything that lives in /bin [jake@jace]/bin% "find" /bin/ ...
1
vote
2answers
2k views

Why does pipe not work with cat and locate?

I am trying to perform this: locate pg_type.h | cat But this command simply does nothing different than locate pg_type.h What should I change ? I want to perform cat pg_type.h wherever pg_type.h ...
0
votes
1answer
144 views

Change where mlocate stores the database?

Looks like it's not configurable through /etc/updatedb.conf, and not mentioned in its manual as well. So can I change that?
4
votes
4answers
207 views

Restrict search of locate to specific directories

Is there a way to restrict locate output to specific directories on Mac OS X Snow Leopard? I read about using regex on a Ubuntu forum. However, on my mac locate does not accept -r option. I also ...
6
votes
2answers
771 views

Make `locate` able to search files on external HDD

If I understand correctly, the database locate relies on is just for files on partitions of internal HDDs. I wonder if it is possible to use locate on external HDDs?
9
votes
2answers
403 views

Trying to “locate” and then open a file

Suppose that I have a file named filename123.txt and it is the single file that is named so, and I can locate it with the command locate filename123. And it returns only this file. Now I want to open ...
3
votes
2answers
523 views

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?
-3
votes
1answer
132 views

How to find files in Linux using “locate”? [closed]

I would like to use this command to find some files.
4
votes
1answer
177 views

How can I act on the results of the “locate” command?

I'm trying to find where check_dns is defined in nagios' commands.cfg file, although there are quite a few files. I know I could run something like find / -name "command.cfg" -exec grep check_dns {} ...
9
votes
1answer
3k views

How do I enable locate and queue the database to be built?

On a new Ubuntu 10.4 instance, I tried to use the locate command only to receive the error locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory from using this command ...
7
votes
4answers
11k views

How to find a file in the filesystem from the command line?

I'm fairly new to Linux, and I've now found myself in a situation where I'd like to find where a file (with a partially-known filename) is in the file system. I'd like to know how to do this from the ...
4
votes
1answer
1k views

How to exclude directories with blanks via locate's PRUNEPATHS?

I would like to exclude some Windows folders on an NTFS mount from being indexed by locate. I'm familiar with the PRUNEPATHS syntax in /etc/updatedb.conf. It is a white-space separated list of ...