Questions tagged [locate]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
28 views

For loop and locate command with regular expression mismatched

when I change any configuration I made a copy of the original file with suffix .original. Now I am composing a simple script that will find all *.original files and work with both versions, ie with ...
0
votes
1answer
18 views

Can I use locate's functionality to find symlinks faster?

I've just read: How to find all symbolic links pointing to any file/directory inside a given directory but that is pretty slow. Now, on typical Linux systems, a filesystem database-of-sorts is ...
-1
votes
1answer
34 views

Can GNU FindUtils be configured to skip a directory?

When I run updatedb I get an error "Permission denied" to /run/user $ sudo updatedb /usr/bin/find: '/run/user/1000/doc': Permission denied Note my version of updatedb comes from the package ...
0
votes
2answers
27 views

`locate` in linux vs osx

I often use locate as a command to find stuff system-wide. However, I find it very annoying that the osx version of locate doesn't seem to have the -b option to match the basename only; and so prints ...
0
votes
3answers
176 views

ifconfig and locate command not found

I am new in linux-ubuntu and I see ifconfig the not found in terminal and I writed sudo yum install new-tool but came yum the not found error . What means that ,must I install ifconfig ? or are there ...
5
votes
1answer
67 views

Understanding locate command regex

To use locate command with regex , do we need to enclose the pattern in quotes along with passing --regex option ? If yes, then what do the following mean - a) locate --regex file* ? Here regex will ...
3
votes
1answer
150 views

“locate” returns relative instead of absolute paths

One advised me to post here since this would be more appropriate (I am going to remove the previous one). On my MacBook, I have the following entry in root's crontab: 0 */4 * * * cd /private/var/root &...
0
votes
1answer
23 views

How can I see the main package for a given program in Centos 8

I want to know which exact installed package that allows a program to run, I used locate <program_name> command, but that seems to throw all related files a directories that contains that ...
1
vote
1answer
26 views

locate: regex repetition postfix operator doesn't work with --regextype emacs

I have some files whose the names are of the form krita-NN.kra where NN is a number having one to two digits. I wanted to locate them using Emacs regex. However, the repetition postfix operator (\{n, ...
2
votes
1answer
46 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
35 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
86 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
34 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
176 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
41 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
146 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
109 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
106 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
644 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
34 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
1k 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
156 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
156 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
275 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
397 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
191 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
572 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 ...
4
votes
2answers
488 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
101 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
112 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
37 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
90 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
381 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
104 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
121 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
494 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
398 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
100 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
63 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
554 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
99 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
218 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
631 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
682 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
91 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
534 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
98 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
29 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?