Locate/find -

Tim ignored_mailbox at yahoo.com.au
Mon Nov 26 15:30:07 UTC 2012


Bob Goodwin:
> Is there a way/command that will find all instances of files such as
> "*.ncd" on the external hard drive:
> 
> /run/media/bobg/Simple/Box8BkU/
> 
> updatedb and locate with it mounted do not find anything? Often
> times it would be convenient to do but locate seems only to want to
> work on the internal drives [for me].

Which paths will be used, or ignored, for things like the "locate"
command are configured in the /etc/updatedb.conf file.  By default, 
the mount points for external drives are ignored, but you can change
that, if you like.  Just edit that file.

The logic is that the locate command should only give you results that
you can use, and external drives are considered temporary, and may not
be available.  So, being told that the file you asked for is located on
some particular place that isn't currently mounted, doesn't do you a
great deal of good.

If you have things that are sometimes mounted externally, and some other
things that are always mounted externally, you could prune specific
filepaths, rather than general ones.  e.g. Rather than prune /media/,
you might prune /media/flashdrive, leaving /media/backup to be indexed
(those being example names that I've just made up for this sentence).

-- 
[tim at localhost ~]$ uname -rsvp
Linux 3.6.7-4.fc17.x86_64 #1 SMP Tue Nov 20 19:40:01 UTC 2012 x86_64

All mail to my mailbox is automatically deleted, there is no point
trying to privately email me, I will only read messages posted to the
public lists.





More information about the users mailing list