DEV Community

Rodrigo de Avila
Rodrigo de Avila

Posted on

How to find a file by content?

This tip works on both Linux and macOS.

grep -lr "my text" *.txt
Enter fullscreen mode Exit fullscreen mode

This command:

  • list files with the pattern my text
  • recursively
  • in all *.txt files

Top comments (0)