Web lists-archives.com

Re: An appropriate directory search tool?

On 2018-10-21 02:16, John Crawley wrote:
On 20/10/2018 19.28, Richard Owlett wrote:
...I would have expected to use an explicit pipe command between 'find' and 'grep'.

In fact, depending on the exact conditions of your search, you might
not need to use find at all. 'grep -r' will do a recursive search,
starting at whatever directory you give it, looking inside every file
for some content. Like:

grep -r 'keyword_or_regex' dirname

Of course, 'man grep' for various options...

certainly grep especially if you can't remember where you put something.
If it's just filenames then I like 'locate' as it seems quick once the database is updated.
apart from the default look "everywhere" there's

"updatedb -o db_file -U source_directory"

"locate -i -d db_file text_to_look_for"

"-i" ignores case

as an aside there is so much to try to understand about how this stuff is organised and all the syntax for bash, perl and the useful provided software that you can spend a great deal of time there. Especially if you are a little bit elderly perhaps better to be familiar with just the things you need to get your project done.


Key ID    4BFEBB31