ag

ag

TLDR

Find files containing "foo", and print the line matches in context

>_ ag [foo]
copy

Find files containing "foo" in a specific directory

>_ ag [foo] [path/to/directory]
copy

Find files containing "foo", but only list the filenames

>_ ag -l [foo]
copy

Find files containing "FOO" case-insensitively, and print only the match, rather than the whole line

>_ ag -i -o [FOO]
copy

Find "foo" in files with a name matching "bar"

>_ ag [foo] -G [bar]
copy

Find files whose contents match a regular expression

>_ ag '[^ba(r|z)$]'
copy

Find files with a name matching "foo"

>_ ag -g [foo]
copy

Copied to clipboard
free 100$ digital ocean credit