Questions tagged [ag]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

use ag to search for wildcard-pattern and grep to only print unique findings acc to the pattern

ag --java -Ui "@*" does already include the findings like @Controller @PointCut @Entity but also a lot of content around the findings. I'm trying to filter out all annotations used in several java ...
0
votes
0answers
26 views

How to create a regex matching a custom string at the beginning of line while ignoring all preceding whitespaces via ag silversearcher?

Give an example file with the content: // find me val ignore me = "" // I should not be found // find me // find me I want to find all the lines with find me using ag silversearcher. ...
0
votes
3answers
40 views

Is it possible to print a search pattern result just until it hits a blank newline in terminal?

Say for example I have a file with contents like this: # TODO: Optimize this. alias bash='start bash' # FIXME: Just fix this. alias fix='there is something wrong with this What I want is if I ...
1
vote
1answer
345 views

How is ripgrep different from silver searcher ag? [closed]

Are these related? Which is faster? Can either be limited to directory-names? https://github.com/BurntSushi/ripgrep https://github.com/ggreer/the_silver_searcher
0
votes
1answer
333 views

search with and without a pattern with ag

With two files with echo 'example.com/call_me?param' > file1.txt echo 'example.com/call_me_maybe?param' >> file1.txt echo 'example.com/call_me?' >> file1.txt echo 'example.com/call_me?...
1
vote
0answers
25 views

Can ag search sub-directories with the same name, within a bunch of directories?

Given a directory structure such as: dev/project1/assets/** dev/project2/assets/** dev/project3/assets/** Is it possible to search, from within the dev directory all assets directories only. Given ...
0
votes
1answer
44 views

Ack/Ag does not return search result without *

I am trying to search text in a directory and it turned out that the following syntaxes do not return any result ack -i "0xabcdef" ./ ack -i "0xabcdef" ack -i "0xabcdef" . while the following ...
4
votes
3answers
2k views

How to ignore multiple files with `ag` The Silver Searcher

There is an option --ignore which allows specifying files to ignore. At the moment I only managed to ignore multiple files by doing --ignore file1 --ignore file2....... Trying to use --ignore "*...
18
votes
1answer
7k views

How do I use ag to look for text in files with certain extensions?

I'm using ag (The Silver Searcher) version 0.31.0. I can easily look for a string in a bunch of files using: localhost:workspace davea$ ag 'ftp' . But what if I only want to scan files with certain ...
6
votes
2answers
408 views

How to make this search faster in fgrep/Ag?

I am thinking methods to make the search faster and/or better which principally uses fgrep or ag. Code which searches the word and case-insensitively at $HOME, and redirects a list of matches to vim ...
2
votes
2answers
209 views

How do I force ag (the silver searcher) to list empty files

How do I get ag to list all files, including empty ones? +ravi@boxy:~$ mkdir new && cd new +ravi@boxy:~/new$ echo stuff > non-empty && touch empty +ravi@boxy:~/new$ ag -ul non-...
3
votes
2answers
307 views

how to issue a `start of string` pattern for ag

I want to find every file in from the current dir and downwards whose filename starts with foo using ag(the silver searcher). I have tried: ag -g '^foo' ag -g '\^foo' ag -g '\Afoo' no luck. But ...
0
votes
1answer
244 views

Why is ag printing blank lines from this file?

I want to use ag to print the classes and their methods in a python file. I thought that this would be easy using: ag --context=0 --nocolor -os '^\s*(def|class)\s+[_A-Za-z]*' prog.py but for reasons ...
3
votes
1answer
378 views

No output using parallel in tandem with ag or ack

I have a list of java reserved words, first letter capitalised. $ tail -n5 ~/reservedjava.txt Break While True False Null I'm trying to look through all my java source code to find methods that look ...