11

I love ag :: the_silver_searcher but I am wondering how can I perform a search non-recursively.

Sometimes I want to search only inside files from my home directory but without looking in subdirectories.

sorin
  • 161,544
  • 178
  • 535
  • 806

1 Answers1

15

Check the depth option from the manual :

--depth NUM : Search up to NUM directories deep, -1 for unlimited. Default is 25.

Charles Paulet
  • 191
  • 1
  • 2
  • 1
    Thanks! Worked perfectly. It seems that I lost my ability to properly RTFM. – sorin Dec 20 '16 at 10:03
  • Note that Emacs's **helm-ag** requires the use of the = separator for the long option, e.g. for current directory: `--depth=0` – kotchwane Mar 22 '20 at 15:56