You can also use the standard bash loop for this:
for i in text*; do grep "pattern" $i; done
or even the best option without a loop:
grep "pattern" text*
If you click the tab after * , then the shell expands it to files that satisfy the condition.
source share