Questions tagged [locate]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
836 views

How indexing works with locate command?

locate command searches an index that the system builds periodically. How to make sure, any new file you're looking is part of index? Is there any explicit command to index?
2
votes
5answers
368 views

Quick way to open results from `find` or `locate`

When I run find or locate, the matching files will populate stdout, one file per line. The next step is often that I want to open one of these files. This would be faster and more efficient if I did ...
1
vote
3answers
108 views

How can I choose one of `locate`'s results and let it be opened with a specified application

I have a bash script called findme, which is coded as follows: #!/bin/bash locate -Abi '*\.'$1 $2 | grep --color=always -ni $2 | less -R It searches for me for all files with a specified file ...
1
vote
1answer
40 views

locate is not locating the file present in the current directory

That media is another hard disk in the computer. What is the way to locate things there?
1
vote
2answers
161 views

locate(1) buffers its output [duplicate]

I'm using locate(1) from GNU findutils for a little task and it seems as if it buffers its output. I am piping the output of locate to another task that will process the lines as locate finds them. ...
1
vote
1answer
258 views

locate outputs question marks when locatedb contains certain characters (tabs) unless output is piped

I construct my own locatedb using frcode so it would contain filesizes after paths (it helps me look for large files quickly). I store the path separated from the size by a tab character. I've noticed ...
0
votes
2answers
10k views

Where is the current wallpaper stored in Kali Linux?

I have a script that sets one exact image as a wallpaper and I want it to check at every run if it's still the same image. If not, it asks you if you want to change wallpaper again to this image. It's ...
6
votes
4answers
4k views

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: /...
0
votes
1answer
51 views

How to locate exactly that executable, which will be run if it's name entered in command line? [duplicate]

Is it possible to locate exactly that executable myname which will be run if passed to command line > myname locate command didn't work as expected, since it returns numerous results. Result ...
1
vote
2answers
100 views

Search tool with file content indices

Are there any file search tools like gnome-search-tool (gui where I can select several options, like age of file, file-size, owner, etc) that uses DB indices for not only the file name but the file ...
0
votes
2answers
301 views

Why can't 'locate' or 'find' find 'makeinfo'? [closed]

When I do: locate makeinfo OR find / -name "*makeinfo*" I get nothing. But when I do makeinfo --help, it gives me the proper help output. How is this possible? If makeinfo is an executable, it ...
1
vote
2answers
85 views

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/...
17
votes
2answers
15k views

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

Search for and remove files safely

I would like to search for all the nohup.out in my mounted filesystems, and delete them. There are some directories and files whose filenames contain space, so I think of xargs -0. To be safe, I ...
0
votes
1answer
67 views

Shorthand alternative to find

Is there any alternative out there for find similar to ag and ack? I'm really tired of having to type: find some/app -iname "some_file*" I much rather just type: find "some_file*" And have it ...
3
votes
2answers
732 views

Faster search than find

Is there a way to find things faster than find . I am/was doing :- $sudo find / -perm +4000 But it takes ages to find the required info. and I know that most of the files which would that specific ...
1
vote
1answer
106 views

Regex quantifiers are not working well with locate

This output is rather self-explanatory: XXXXX@debianvirtualbox:~$ locate -r "^/var/lib/tomcat[0-9]/.*" -l 10 /var/lib/tomcat8/conf /var/lib/tomcat8/lib /var/lib/tomcat8/logs /var/lib/tomcat8/webapps /...
6
votes
1answer
3k views

What exactly files whose names' prefix is “AT.postflight.” are needed for?

I am not sure if this question should be asked here, since I am on an OS X, but since I am using bash, and I am asking about the meaning and the purposes of some files. I am trying to understand why ...
1
vote
1answer
348 views

Locate --regex with negative lookahead

Problem I tried to implement a negative lookahead when searching a file with locate like this: locate --regex "apple(?!t)" However I'm getting the following error, because there seems to be some ...
1
vote
2answers
1k views

how to store output of a command into array with each value in a double quote

I want to store each output in double quoted array values. values can have space also. FOUNDFILES=($(locate --database ~/.locate.db -i -b "$INPUT")) if input to the locate command is very very ...
11
votes
1answer
2k views

How is updatedb so much faster than find?

How is updatedb so much faster than find? Here's a timed comparison between updatedb and a find command that does a seemingly similar task. compare.sh #!/usr/bin/env bash cmd="sudo updatedb" echo $...
1
vote
1answer
320 views

updatedb.conf, Ignore files using pattern match/globbing

Running locate command with a file name returns multiple entries as, a.py a.pyc a.py~ Obviously, i am not looking for binaries/compiled files. I tried to configure locate command to ignore files ...
6
votes
1answer
2k views

No output from locate command

I usually find the answers to all my Unix related problems already posted as questions and answers. However, this particular issue has had me stumped for the past hour so I thought I’d ask my first ...
0
votes
1answer
51 views

Can't find the location of DUMPed file system

I dumped a file system, chose the name for the dump ("home_fs_dump"), the dump was declared successfull, and yet I couldn't locate this name anywhere in the system. (And at the end I tested if locate ...
0
votes
0answers
157 views

mlocate not returning any results for known file, even after updatedb

I am speechless... [root@Centos-PHP56 webroot]# ls -al php_errors.log -rw-r--r-- 1 apache apache 327 Apr 21 01:49 php_errors.log [root@Centos-PHP56 webroot]# updatedb [root@Centos-PHP56 webroot]# ...
8
votes
3answers
7k views

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?
14
votes
6answers
7k views

Exclude directories in locate search

A search with locate finds paths in the filesystem. Often, you know a priori you are interested in either files only, or directories only. A 'locate' search often returns many results. It would be ...
2
votes
2answers
211 views

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 ...
1
vote
1answer
665 views

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$ ...
0
votes
1answer
229 views

Open a result of `locate` with `vi`

I'd like to get the nth (3rd) result of locate, and then open it to vi. $ locate /private/etc/my.cnf /private/etc/my.cnf.bak_ /usr/local/mysql-5.6.22-osx10.8-x86_64/my.cnf ....
4
votes
1answer
1k views

Getting globbing to work with `locate`?

I'm on Ubuntu 11.04, where I have: $ locate --version mlocate 0.23.1 [...] The man locate page says: If --regex is not specified, PATTERNs can contain globbing characters. If any PATTERN ...
3
votes
2answers
378 views

Including Directories in Locate on Mac OS X

Can anybody shed light on which directories OS X decides to put in the locate database and which it decides to omit? It's pretty clear that ~/Library is out - which others? And how do I modify this ...
5
votes
1answer
351 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 ...
0
votes
1answer
114 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
108 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 ...
7
votes
3answers
9k views

How to add specific directories to “updatedb” (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
57 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 ...
5
votes
5answers
15k 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 ?
2
votes
2answers
2k 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!
84
votes
3answers
109k 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 commit, in order for the indexer to trigger? I'm ...
3
votes
2answers
421 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 ...
8
votes
4answers
10k 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 also ...
4
votes
1answer
779 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
281 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 ...
8
votes
1answer
5k 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 ...
3
votes
2answers
644 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?
3
votes
2answers
99 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 ...
2
votes
1answer
377 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, ...
3
votes
3answers
2k 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 ...
15
votes
2answers
19k 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 /...