I am trying to search for files that have pattern FW
.
From these filtered files I am trying to search for pattern chmod.*archive|archive.*chmod
, then list them.
I tried with the below command, but it doesn't give me the desired output. Need help to get this issue sorted out.
find . -name '*FW*' -exec sh -c "cat {}|grep -iEq 'chmod.*archive|archive.*chmod'|ls" \;|more
ls
, so that part won't work. – terdon Apr 02 '20 at 16:15ls
does not read from stdin. – ctrl-alt-delor Apr 02 '20 at 16:21sh -c
. Still, for future reference: never embed{}
in the shell code. – Kamil Maciorowski Apr 14 '21 at 15:16