to search for a particular pattern in all files i have used this command
Expand|Select|Wrap|Line Numbers
- find $dir -type f -print | xargs grep -E -n -w <pattern> | tee my res.txt
filename : line number : matching line
I would like to have something like this in my output file
filename : line number : matching line : match
the solution that i wondering was that i would redirect my output to another command
Expand|Select|Wrap|Line Numbers
- grep -o <pattern>
Expand|Select|Wrap|Line Numbers
- find $dir -type f -print | xargs grep -E -n -w <pattern> | tee -a my res.txt | grep -o pattern | tee -a myres.txt