How do I search for text in all files in Linux?

How do I search for text in all files in Linux?
Answer
How do I find all files containing specific text on Linux?
  1. remember that grep will interpret any . …
  2. anyway, you were almost there! …
  3. find … -exec <cmd> + is easier to type and faster than find … -exec <cmd> ; . …
  4. To search non-recursively in a given path the command is `grep –include=*.txt -snw “pattern” thepath/*.
 

Tìm kiếm

Back
Top