Malarose03
New Member
How can i first search with certain filename with wild card and then search a string in those filename and get the output.
E.g
Directory name : abc/def/xyz/
Files in directory : Abc12, abc13, abd12,abc14,abc15, abe12 and so on.
First search : ab*12
Output : abc12,abd12,abe12
Now search string 'pull' in the output files from first search and display the output with filename and the line where string is present.
I tried with below but no luck :
Ls -lrt Grep 'ab.*12' | xargs grep pull
May be a single command or a series of command that i can put in a script and execute, anything will do as long as the output comes as desired.
Thanks in advance.
E.g
Directory name : abc/def/xyz/
Files in directory : Abc12, abc13, abd12,abc14,abc15, abe12 and so on.
First search : ab*12
Output : abc12,abd12,abe12
Now search string 'pull' in the output files from first search and display the output with filename and the line where string is present.
I tried with below but no luck :
Ls -lrt Grep 'ab.*12' | xargs grep pull
May be a single command or a series of command that i can put in a script and execute, anything will do as long as the output comes as desired.
Thanks in advance.