Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #201440 > unrolled thread

An appropriate directory search tool?

Started byRichard Owlett <rowlett@cloud85.net>
First post2018-10-19 17:10 +0200
Last post2018-10-20 15:30 +0200
Articles 7 on this page of 47 — 16 participants

Back to article view | Back to linux.debian.user


Contents

  An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-19 17:10 +0200
    Re: An appropriate directory search tool? Roberto C. Sánchez <roberto@debian.org> - 2018-10-19 17:20 +0200
    Re: An appropriate directory search tool? Roberto C. Sánchez <roberto@debian.org> - 2018-10-19 17:20 +0200
    Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-19 17:30 +0200
      Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-19 17:40 +0200
        Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-19 17:50 +0200
        Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-20 15:30 +0200
    Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-19 17:50 +0200
      Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-19 18:10 +0200
        Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-30 16:00 +0100
          Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-12-01 18:20 +0100
    Re: An appropriate directory search tool? songbird <songbird@anthive.com> - 2018-10-20 00:40 +0200
    Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 11:40 +0200
      Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-20 11:50 +0200
        Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 12:30 +0200
          Re: An appropriate directory search tool? Joe <joe@jretrading.com> - 2018-10-20 13:40 +0200
            Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 14:30 +0200
              Re: An appropriate directory search tool? Brian <ad44@cityscape.co.uk> - 2018-10-20 21:10 +0200
                Re: An appropriate directory search tool? Håkon Alstadheim <hakon@alstadheim.priv.no> - 2018-10-21 00:00 +0200
                  Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-21 12:10 +0200
                Re: An appropriate directory search tool? Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2018-10-21 11:00 +0200
                  Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-21 11:20 +0200
          Re: An appropriate directory search tool? Roberto C. Sánchez <roberto@debian.org> - 2018-10-20 14:10 +0200
          Re: An appropriate directory search tool? John Crawley <john@bunsenlabs.org> - 2018-10-21 03:20 +0200
            Re: An appropriate directory search tool? mick crane <mick.crane@gmail.com> - 2018-10-21 07:30 +0200
            Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-21 12:30 +0200
              Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 15:50 +0200
                Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 16:40 +0200
                  Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 17:30 +0200
                    Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 17:50 +0200
                      Re: An appropriate directory search tool? Curt <curty@free.fr> - 2018-10-21 18:40 +0200
                      Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 18:40 +0200
                        Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 19:20 +0200
                          Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 21:00 +0200
                            Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 23:50 +0200
                Re: An appropriate directory search tool? John Crawley <john@bunsenlabs.org> - 2018-10-22 03:20 +0200
                  Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-22 17:30 +0200
                Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-22 15:20 +0200
                  Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-22 17:30 +0200
                    Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-22 17:50 +0200
          Re: An appropriate directory search tool? Curt <curty@free.fr> - 2018-10-21 12:00 +0200
        Re: An appropriate directory search tool? Joe <joe@jretrading.com> - 2018-10-20 13:30 +0200
          Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 14:30 +0200
      Re: An appropriate directory search tool? Étienne Mollier <etienne.mollier@mailoo.org> - 2018-10-20 12:30 +0200
        Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 14:40 +0200
          Re: An appropriate directory search tool? Dan Purgert <dan@djph.net> - 2018-10-20 15:20 +0200
          Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-20 15:30 +0200

Page 3 of 3 — ← Prev page 1 2 [3]


#201500

FromCurt <curty@free.fr>
Date2018-10-21 12:00 +0200
Message-ID<wLiGB-2wp-7@gated-at.bofh.it>
In reply to#201472
On 2018-10-20, Richard Owlett <rowlett@cloud85.net> wrote:
>
> But they did.
> That's why I wrote 'My take away from answers so far is "A script will 
> be required." '
> Perhaps we have different ideas of the definition of "script".
> I saw the examples which worked as scripts (even if written as one 
> liners). If I had attempted to use bash, I would have expected to use an 
> explicit pipe command between 'find' and 'grep'.
>

If you want to search a specific directory for files that do not contain
a certain string (a desire I believe you expressed somewhere along the
way), grep alone appears to meet that bill:

 grep -rL ~/my_directory -e "my string"

Of course, this is now a case of the blind guy appointing himself king of the
realm of the one-eyed man (you in this strained analogy).


-- 
"Now she understood that Anna could not have been in lilac, and that her charm
was just that she always stood out against her attire, that her dress could
never be noticeable on her." Leo Tolstoy, Anna Karenina 

[toc] | [prev] | [next] | [standalone]


#201474

FromJoe <joe@jretrading.com>
Date2018-10-20 13:30 +0200
Message-ID<wKXCa-74A-3@gated-at.bofh.it>
In reply to#201470
On Sat, 20 Oct 2018 11:44:37 +0200
<tomas@tuxteam.de> wrote:

> On Sat, Oct 20, 2018 at 04:32:43AM -0500, Richard Owlett wrote:
> > I think my original post needs a rewrite ;/
> > 
> > I'm looking for a directory search tool with specific capabilities
> > which would fit comfortably with my work environment.  
> 
> [...]
> 
> > I suspect that what I want would most likely be a command line tool.
> > Perhaps a script will be required. But, before reinventing the
> > wheel, I ask "Does an appropriate command already exist?"  
> 
> [...]
> 
> Judging by your (second) post, I get the feeling that the answers
> given in this list haven't reached you (at whatever level). Most
> of them were quite positive: "yes, such a tool exists, it's called
> 'find'", some of them even implemented a sketch of a solution to
> your concrete example.
> 
> Since you don't even try to make reference to *any* of the numerous
> proposals flung around here, I'm at a loss on how to help you.
> 
> For now, I'll just give up, sorry.

I took it to mean that he wants a GUI tool.

-- 
Joe

[toc] | [prev] | [next] | [standalone]


#201480

FromRichard Owlett <rowlett@cloud85.net>
Date2018-10-20 14:30 +0200
Message-ID<wKYye-7C8-11@gated-at.bofh.it>
In reply to#201474
On 10/20/2018 06:24 AM, Joe wrote:
> On Sat, 20 Oct 2018 11:44:37 +0200
> <tomas@tuxteam.de> wrote:
> 
>> On Sat, Oct 20, 2018 at 04:32:43AM -0500, Richard Owlett wrote:
>>> I think my original post needs a rewrite ;/
>>>
>>> I'm looking for a directory search tool with specific capabilities
>>> which would fit comfortably with my work environment.
>>
>> [...]
>>
>>> I suspect that what I want would most likely be a command line tool.
>>> Perhaps a script will be required. But, before reinventing the
>>> wheel, I ask "Does an appropriate command already exist?"
>>
>> [...]
>>
>> Judging by your (second) post, I get the feeling that the answers
>> given in this list haven't reached you (at whatever level). Most
>> of them were quite positive: "yes, such a tool exists, it's called
>> 'find'", some of them even implemented a sketch of a solution to
>> your concrete example.
>>
>> Since you don't even try to make reference to *any* of the numerous
>> proposals flung around here, I'm at a loss on how to help you.
>>
>> For now, I'll just give up, sorry.
> 
> I took it to mean that he wants a GUI tool.
> 

No.
I date from days of 026, KSR-35, VT 100 , S100 and CPM-80.
Many years spent with M$ Windows --> gui user.
If a GUI does the task, good.
However flexibility frequently requires working with command line.

[toc] | [prev] | [next] | [standalone]


#201473

FromÉtienne Mollier <etienne.mollier@mailoo.org>
Date2018-10-20 12:30 +0200
Message-ID<wKWG5-6wE-3@gated-at.bofh.it>
In reply to#201469
Good Day,

On 10/20/18 11:32 AM, Richard Owlett wrote:
> I think my original post needs a rewrite ;/

Well, let's stick to the text then...

> I'm looking for a directory search tool with specific capabilities which would fit comfortably with my work environment.
> 
> The "MATE Search Tool" comes close.
> It can:
>   Select a starting directory.

	$ find doc/

>   Search for a specific extension.

	$ find -iname '*.tex'

>   Search for a keyword in file content.

	$ find -exec grep -Eq "\<keyword\>" '{}' \; -print

> It cannot:
>    Search ONLY the specified directory.

	$ find -maxdepth 1

>    Return files that DO NOT contain a keyword.

	$ find -not -exec grep -Eq "\<keyword\>" '{}' \; -print

Putting it all together, that would give that sort of command:

	$ find doc/ \
	>	-maxdepth 1 \
	>	-iname "*.tex" \
	>	-not -exec grep -Eq "\<keyword\>" '{}' \; \
	>	-print

The order of search options is important, as each one refines
a bit more the search field among the files.

> "ls" can search by extension and stay in specified directory but not
> include/exclude keywords.

"ls" is good for listing directory content.  "find" is designed
to find files on their inode information (name, last modification
date, size, that kind of stuff).  As soon as you need to deal
with text inside that file, you also need to include execution
of commands designed to read the file and return or not in error
depending on the presence of keywords: "grep" is such a command.

> I suspect that what I want would most likely be a command line too> Perhaps a script will be required. But, before reinventing the wheel, I ask "Does an appropriate command already exist?"

Yes, "find" as command line, will do the job.

> [My immediate problem involves only a couple dozen files so a manual search is feasible.]
> 
> My take away from answers so far is "A script will be required."

Not necessarily, the trouble is: "find" is so vast, you can
spend hours in the manual to search for adequate option for
your specific need, and end up writing a script, instead of
having found "the proper option".

> As I am exploring Tcl/Tk and this tool would provide input to a current Tcl project, I will use it rather than bash.

Note that at no moment Bash has been mentioned.  You could
have launched all these "find" instances from an exec() call
in whatever language you with to use.  :-)

> Thank you.

Kind Regards,
-- 
Étienne Mollier <etienne.mollier@mailoo.org>

[toc] | [prev] | [next] | [standalone]


#201483

FromRichard Owlett <rowlett@cloud85.net>
Date2018-10-20 14:40 +0200
Message-ID<wKYHT-7Fh-1@gated-at.bofh.it>
In reply to#201473
On 10/20/2018 05:23 AM, Étienne Mollier wrote:
> [snip]
>> My take away from answers so far is "A script will be required."
> 
> Not necessarily, the trouble is: "find" is so vast, you can
> spend hours in the manual to search for adequate option for
> your specific need, and end up writing a script, instead of
> having found "the proper option".

I don't think "find" itself is the problem.
Debian seems to do some 'black magic' to conflate "standard output" and 
"standard input". Otherwise a pipe command would be required between 
"find" and "grep".

[toc] | [prev] | [next] | [standalone]


#201486

FromDan Purgert <dan@djph.net>
Date2018-10-20 15:20 +0200
Message-ID<wKZkB-87i-13@gated-at.bofh.it>
In reply to#201483
Richard Owlett wrote:
> On 10/20/2018 05:23 AM, Étienne Mollier wrote:
>> [snip]
>>> My take away from answers so far is "A script will be required."
>> 
>> Not necessarily, the trouble is: "find" is so vast, you can
>> spend hours in the manual to search for adequate option for
>> your specific need, and end up writing a script, instead of
>> having found "the proper option".
>
> I don't think "find" itself is the problem.
> Debian seems to do some 'black magic' to conflate "standard output" and 
> "standard input". Otherwise a pipe command would be required between 
> "find" and "grep".

No it doesn't. find has functionality built in to pass results onward
(-exec or -xargs)


-- 
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281

[toc] | [prev] | [next] | [standalone]


#201487

Fromrhkramer@gmail.com
Date2018-10-20 15:30 +0200
Message-ID<wKZuh-8ar-1@gated-at.bofh.it>
In reply to#201483
On Saturday, October 20, 2018 08:35:51 AM Richard Owlett wrote:
> I don't think "find" itself is the problem.
> Debian seems to do some 'black magic' to conflate "standard output" and
> "standard input". Otherwise a pipe command would be required between
> "find" and "grep".

I didn't go back all the way in the thread to look for a command without a 
pipe between find and grep, but, the line I did find using both find and grep 
used -exec as that black magic.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | linux.debian.user


csiph-web