Skip to main content
2 of 2
-r/-R are not the same
maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298

Yes, there is grep. It has an option for recursive directory traversal, e.g.:

$ grep -r specificstring path

With GNU grep you can restrict the searched files with the --include and --exclude pattern options.

-H ('Print the file name for each match') is the default with -r, -R and when you specify multiple files on the command line. -R also turns on recursive directory traversal but also follows symbolic links.

You can also pipe the results of grep to less for screen paging.

maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298