Dear Users
I have pretty basic usage of the common 'find' and 'locate' commands which I prefer over other tools for searching files/folders.
I know there are indexing software like recoll or beagle, but they put out too many results. I name files/dirs in a very structured way: the typical file/directory name in my system is
2017_10_12_abc_def_ghi
it starts with an important date (usually the one I started/finished to work on the file), "abc", "def", "ghi" are descriptors/keywords that tell me about the content according to some hierarchy of mine. Let's say that any string separated by underscores is a Keyword/descriptor in my naming scheme.
The problem is that I'd like to construct a script (maybe based on find/locate) that does the following: in a given path it looks recursively to find all files/dirs whose names descriptors contain a list of possible strings
For example the following
Code:
command_name path_name "ab" "hi"
should look recursively into 'path_name' and search for all files/dirs that have keywords containing at least one of the two srings (that is "ab" or "hi"). So for instance such a command should give
2017_10_12_abc_def_ghi
as a result, but not
2017_10_12_cba
I tried to construct such a thing with find/locate commands, but I might be too basic to come up which something working. Wha it is most difficult to me is that the list of possible keaywords over which to look should be of variable length.
Does anybody have some idea if this is possible to do?
Regards
Pierre