Try looking at man updatedb.conf because you can configure updatedb, used by locate, to exclude specific files and/or directories. Or you can generate your own list of files by using the find command. With a good editor you can just remove the files you don't want scanned and do this: cat mylistoffiles | fgrep .... Many ways to solve this problem. YMMV depending on the problem specifics and the solution chosen. On 03/08/2015 01:22 PM, joe@actionline.com wrote: > How can I exclude a specified directory (or perhaps more than one) > from a 'locate' search for files containing a certain name or word > on my system? > > For example, I frequently now use the following: > > $ locate filename | fgrep -ya "/home/joe" > > How could I modify that to exclude all files with the specified > filename in one (or more) specified subdirectories? > > > > --------------------------------------------------- > PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org > To subscribe, unsubscribe, or to change your mail settings: > http://lists.phxlinux.org/mailman/listinfo/plug-discuss > > --------------------------------------------------- PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org To subscribe, unsubscribe, or to change your mail settings: http://lists.phxlinux.org/mailman/listinfo/plug-discuss