I've installed unixutils,and grep string * can search string in the current directory,

but how to make it search recursively?

  • Here's what I use with unixutils, because searching for all file types might slow me down. Note you can also change . to a different directory if you want: grep -r --include "file_pattern" -i "my_text" . – aschultz Jun 5 '17 at 18:58

Use the -R switch for a recursive search (or -r or --recursive).

from the man page:

-R, -r, --recursive
          Read all files under each directory, recursively; this is equiv-
          alent to the -d recurse option.

Alternatively, if you don't need grep-specific functionality: Windows supports this out of the box anyway:

findstr /s "string"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.