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
36 views

mlocate: how to print files only [duplicate]

I have the following version of locate: $ locate --version mlocate 0.26 Copyright (C) 2007 Red Hat, Inc. All rights reserved. This software is distributed under the GPL v.2. This program is provided ...
1
vote
0answers
26 views

Rsync running every month can't stop it

I have never used rsync for backup before. I'm not a advanced user by any means, but enjoying Linux. I was following instructions, from a website (have now lost the url) and I managed to set up rsync ...
0
votes
0answers
39 views

Updatedb include the path pointed by symbolic link

I have created mlocate database with the contents of a particular folder. I see that the updatebd doesn't include the path pointed by the symbolic links in the database. How can I include the path ...
0
votes
1answer
19 views

apt-file can not find a dkms file

Before I upgrade to Debian Bullseye, apt-file was pretty logical. Now I can't get it to work. What am I doing wrong? Did the behavior change? # apt-file update Hit:1 http://repo.steampowered.com/...
0
votes
1answer
115 views

sed command does not work with find -exec?

I have this file: file.txt: ... threshold: swipe: 2 pinch: 2 interval: swipe: 2 pinch: 2 No, if I do : $ locate config.yml | while read i; do sed '/swipe|pinch/s/[0-9]/3/' $i; done it ...
0
votes
0answers
20 views

initscripts installed but not found

In my Mint18, I have installed initscripts using apt-get command so that I can use usleep [time] in a bash script. However, I get the error usleep: command not found. I reinstalled initscripts using ...
2
votes
2answers
71 views

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

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

find does not work, locate does

So I have this bit: systemctl list-unit-files | grep --ignore-case networkmanager | grep --ignore-case service | cut --fields=1 --delimiter=" " Which gives as output: NetworkManager-dispatcher....
1
vote
1answer
55 views

Different mlocate database for each user?

This may come across as a silly question because each file and directory on a system can and will have permissions to block an ordinary user from seeing various files- but for added security sake and ...
1
vote
1answer
308 views

How can I change the configuration of /etc/updatedb.conf file?

Based on the man page of the command "updatedb", we can change and override the configuration of /etc/updatedb.conf using the below commands: --prune-bind-mounts FLAG Set ...
0
votes
1answer
28 views

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

Sudo updatedb `/var/lib/mlocate/mlocate.db' is locked due to faulty drive, how to resolve permanently?

This 4.20.3 Arch system its BTRFS formatted / disk is without free space left. It turns out that mlocate is the cause: # du -h --exclude=Volumes -- * 2>/dev/null | sort -hr | head -2 11G var 9.6G ...
3
votes
3answers
150 views

Search for arbitrary files but only list matches in results once

I want to search for arbitrary file/directory names, but only want to list file paths containing the search string at the same position once. Especially not every file within a directory matching the ...
0
votes
1answer
83 views

How to list all files in mlocate database file?

when updatedb is run it generates a mlocate.db file. How to list all the files in the mlocate.db file? locate * is this correct?
1
vote
1answer
188 views

Synapse launcher: what is the difference between the `locate` command and the simple search?

I love Synapse in Xfce and want to know more about improving its use. I use it to restart, logout or shutdown, launch applications, access files and folders. I have been trying to fix a few ...
1
vote
1answer
185 views

Locate doesn't work

System: Linux Mint 19.1 Tessa, edition: Cinnamon Got a problem with a locate command. I created test.txt file on a desktop. After that I did: sudo updatedb However locate test.txt -i still ...
2
votes
3answers
97 views

Locate but exclude names - Linux

I am trying to locate all the files named hosts on a linux PC remotely. The problem is there are almost several thousand files with ghostscript as one of the upper directory names or as part of a ...
3
votes
1answer
400 views

Delete the “locate” database in FreeBSD

After having established the locate command's database indexing file & directory names across my FreeBSD 12 system (as described in this related Question), I now regret doing so because of its ...
3
votes
2answers
326 views

Safe secure way to locate a file in FreeBSD?

In FreeBSD 12, on a freshly-created virtual machine (DigitalOcean), I tried to use the locate command. $ locate java I received an error. locate: database too small: /var/db/locate.database ...
0
votes
1answer
83 views

updatedb is generating an incomplete list of files

I'm running the following command: updatedb -l 0 -o mydatabase.db -U /usr/myfiles1/ Then, locate -d mydatabase.db "" The "" are to show all the contents of mydatabase.db. However, I'm missing ...
0
votes
1answer
98 views

Truncate from beginning in Rofi

I'm using this command for a rofi-locate script (source): xdg-open "$(locate $query | rofi -threads 0 -width 90 -dmenu -i -p "locate:")" Currently all long path results are truncated from the end, ...
0
votes
1answer
31 views

linux file tree database file

When i install mlocate i must run updatedb I was wondering if there is a db file with all the files on the system and their paths is there a msterfile that contains all the file location/names on ...
1
vote
1answer
61 views

Locating font files

There's a utility called fc-list in the fontconfig library, that's good for listing installed fonts. It detected a few hundred system fonts. I ended up using find to locate all files with common ...
2
votes
0answers
322 views

locate: using updatedb to create a database of directories only?

GNU findutils' man page for updatedb says it has a --findoptions parameter. Does it mean I can specify a find-like option there to create a specific database for locate? Like this, to include ...
0
votes
1answer
77 views

How can I find exactly which files have been accessed after a command runs in tcsh?

how can I find which files tcsh reads to TAB complete the second word of a command, as opposed to the first word. I know I can just use whereis complete to see the path to *.1.gz file, but that is ...
0
votes
3answers
39 views

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

The locate command finds files that aren't there

I use a Mac running High Sierra. I am cleaning up my hard drive and I was looking for remnants of a program I deleted from my Mac. I used the locate command like this: locate Canopy. I once had the ...
-1
votes
1answer
431 views

Command which do not locate the real path of command

We have a RHEL 7.x with Hortonworks (HDP) installed and need an advice why we get on which command: no hadoop in ... The Hadoop client is installed under /usr/bin and from env we get [root@...
1
vote
2answers
320 views

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

Solution to change directory passing a directory pattern as the parameter

I'd like to get any script or Linux solution to implement changing directory passing not exactly a directory but a pattern as the parameter. Something like this: # Ex: I'd like to execute a "cd" to a ...
0
votes
1answer
61 views

How to know where the last file created by my current user is located?

I use Ubuntu 16.04 (xenial) with Bash 4.3.48(1) and zip 3.0. In a file containing a bash script (#!/bin/bash) with many different functions, I also have this function used to create a full database ...
0
votes
4answers
460 views

Count number of files that are not symbolic links in output from “locate”

I'm trying to count the number of non-symbolic linked files passed by the locate command. I've tried a number of options and think this is the most promising: locate -r "$PWD.*\.c$" | xargs ...
1
vote
1answer
61 views

How to pass multiple DB files to locate?

I want to pass multiple DB files to the locate command, like this: locate -d ~/.a_locate.db:~/.b_locate.db: -Ai file_to_find But this gives me this error: locate: can not stat () `~/.b_locate.db': ...
0
votes
1answer
200 views

Using regex for locate and grep to get only folders

When I try to search using locate and grep something like: locate A-B | grep .dir The result is: .../A-B-C.dir .../A-B-C.dir/file .../A-B-C.dir/file1 .../A-B-D.dir .../A-B-D.dir/file1 ... How to ...
1
vote
3answers
559 views

changing the default database for locate and mlocate

I managed to run locate and mlocate so that it uses an encrypted partition, i.e. my home folder. See this post. However, how do I make the new, relocated mlocate.db database the default? I now ...
-1
votes
1answer
5k views

Debian unable to locate packages php [closed]

I just started to explore debian for the first time, and wondered if anyone knew anything about the "unable to locate packages" I get this error when I am trying to run ./installer.sh (a file) E: ...
0
votes
0answers
640 views

Is there a way to use find to filter a file list?

I have the output of locate --existing --regex that was quite fast to obtain. A similar find takes several hours - it's a huge volume. I would like to apply further find filters to this file list. ...
1
vote
3answers
83 views

Simple CLI tool for searching

Is there a CLI tool similar to gnome-search-tool? I'm using locate, but I'd prefer that it grouped results where directory name is matched. I get a lot of results where the path is matched which is ...
2
votes
1answer
439 views

How do I compare mlocate.db to what exists now?

I ran rm -rf on /var/cache/lxc, not realizing it was full of symlinks. I've lost a bunch of files, including most of /dev. I have a mlocate.db from 16 hours ago. How do I compare the list of files ...
1
vote
1answer
91 views

Improve search for files by pathnames with locate and grep pipeline

I often use the following pipeline of locate (from findutils) and grep to find files whose pathnames contain two words word1 and word2, without any specific order between each other: locate -i word1 |...
2
votes
0answers
27 views

BSD/macOS updatedb spec?

For linux, the format of mlocate's DB is documented here. Without diving into the source, is there a similar spec for BSD / macOS locate.database available?
1
vote
1answer
32 views

Do some file get excluded from being saved in the locate database?

Does the locate database not save certain files? Like are there files that excluded from the database by default?
-1
votes
2answers
914 views

What situation is `find` and `locate` best used in? [closed]

I know that locate has to have a database generated and is much faster, and that find does not need a database generated and is not as fast. So in what situations is find and locate more efficient/...
0
votes
1answer
3k views

Cannot locate zlib or pcre location after install

I installed zlib1g zlib1g-dev libpcre3 libpcre3-dev with apt for NGINX open source over installing zlib & pcre in their own folders. I cannot seem to locate both zlib & pcre libraries on my ...
2
votes
1answer
145 views

When counting source files and LOC with locate and find - why do Python files come up different?

I am having trouble understanding why find and locate would work differently for C and Python source files. My goal is to count the number source files and the sum of their source code lines for a ...
5
votes
1answer
1k views

How to rename filenames with accents on macOS?

I am trying to rename files that include the character "à". I do the following : rename -v 's/à/a/g' * But it shows all the files as unchanged. Verbose mode shows the same thing. I tried to escape ...
25
votes
3answers
7k views

What kind of database do `updatedb` and `locate` use?

The locate program of findutils scans one or more databases of filenames and displays any matches. This can be used as a very fast find command if the file was present during the last file name ...
0
votes
1answer
179 views

How do i delete everything of specified “name”

A few days ago I installed pcsxr and today I wanted to completely remove everything of pcsxr I tried to purge it but when I execute locate -c pscxr the output was 48 so it means I still have a ...
1
vote
3answers
145 views

how to find occurrences of a file using locate

There are multiple installation of Java on my system, some silently installed by IDEs, and I wanted to find out where they are. So I thought to use locate to find them. My first try of locate java ...
2
votes
1answer
69 views

How to redirect a list of human readable paths to another command?

When working with the output of commands such as locate which produce lists of paths in "human readable form" (i.e. without \ in front of spaces), how do you redirect their output to another command? ...