linux - Unix find command directory hints -
i active user of find command, similar below format:
find . -name '*servername*' -exec zgrep -l 'identifier' {} \;
suppose have hint target file may in directory named abc, possible in find command or of combinations accept hints?
for example, if search first searches in subdirectories named abc there more chances find results, , can break search operation if needed.
i looking similar command:
find --hint dir1|pattern1 . -name '*servername*' -exec zgrep -l 'identifier' {} \;
perhaps want:
find $(find . -type d -name abc ) -name '*servername*' -exec zgrep -l 'identifier' {} +
demo:
$ mkdir /tmp/demo $ cd /tmp/demo $ mkdir -p a/b/abc $ echo identifier | gzip > a/b/abc/one_servername.gz $ find $(find . -type d -name abc ) -name '*servername*'-exec zgrep -l 'identifier' {} + ./a/b/abc/one_servername.gz
Comments
Post a Comment