Web lists-archives.com

Re: An appropriate directory search tool?

On Fri, Oct 19, 2018 at 10:00:25AM -0500, Richard Owlett wrote:
> The "MATE Search Tool" comes close.
> It can:
>   Select a starting directory.
>   Search for a specific extension.
>   Search for a keyword in file content.
> It cannot:
>    Search ONLY the specified directory.
>    Return files that DO NOT contain a keyword.
> I suspect what I want would most likely be what I'm looking for.
> "ls" can search by extension and stay in specified directory.
> It cannot include/exclude keywords.
> My immediate problem involves only a couple dozen files so manual search is
> feasible.
> Suggestions?

I recommend 'find' run from the terminal.

For example, I have a directory tree full of files like shell scripts,
Perl scripts, and also XML documents and their Russian translations.  To
find the XML documents that are not Russian translations, I can do this:

find . -name '*.xml' -a \! -name '*_ru.xml'

Read that as "find, the current director, files named *.xml and not
named *_ru.xml."

It also supports an amazing array of conditions, like newer/older than,
same/different permissions, size, etc.


Roberto C. Sánchez