Grep

rg string in file type

Search for foo in all terraform files.

rg 'foo' -g '**/*.tf'

In a directory:

rg 'foo' -g '*.tf' -- in/a/dir