I'm trying to loop through every file in a directory (including files in its subdirectories) and perform some action if the file meets an if-condition.

Part of my code is as follows:

```
for f in $direc/*
do
        if grep -q 'search_term' $f; then
            #action on this file
        fi
done

```

However, this fails in the case of subdirectories. I would be very grateful if someone could help me out.

Thank you!