The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 362     Votes:  2     ✅ Solution
Tags: command-line   bash   scripts   duplicate   duplicate-files  
Link: 🔍 See Original Question on Ask Ubuntu ⧉ 🔗

URL: https://askubuntu.com/q/1007525
Title: Locate command is returning too many results
ID: /2018/02/19/Locate-command-is-returning-too-many-results
Created: February 19, 2018    Edited:  March 30, 2018
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


I made the mistake of copying the same files to different partitions with good intentions of pruning (deleting) them from the source or target(s) later. Now when I try to locate them I get too many results from locate command:

rick@alien:~$ locate "display-auto-brightness"
/etc/cron.d/display-auto-brightness
/home/rick/Pictures/display-auto-brightness conky.png
/home/rick/Pictures/display-auto-brightness systray.png
/home/rick/Pictures/display-auto-brightness-config 1.png
/home/rick/Pictures/ps display-auto-brightness.png
/lib/systemd/system-sleep/display-auto-brightness
/mnt/e/etc/cron.d/display-auto-brightness
/mnt/e/lib/systemd/system-sleep/display-auto-brightness
/mnt/e/usr/local/bin/display-auto-brightness
/usr/local/bin/display-auto-brightness

The locate command is automatically placing the * wild card after the search string and returning extra undesired results. The .png files should not be returned.

Why is locate returning too many results?

⇧ Seemingly locked in console after CTRL+ALT+F1 --- How to quit? Disable Ctrl-Alt-L's behavior of locking the screen  ⇩