How do I grep a string in a directory?

How do I grep a string in a directory?
Answer
How to use “grep” command to find text including subdirectories
  1. grep -RIn <yor pattern> * Will search from current directories down in all text files.
  2. Wildcard with –include=”*.C” option, @user311346, thanks to @Lekensteyn. –
  3. Use the find and grep combination to recursively search files for a string in current and all sub directories.
 

Tìm kiếm

Back
Top