News for hackers. Stuff that matters.
Re:Programs that have saved me 100+ hours by lindgrenj6 on Thursday March 16, 2017 @11:41PM (#13891269)
Definitely ack (https://beyondgrep.com/). It basically is grep but designed for source code. First off it can be downloaded as a single file (Perl script FTW!), so easy to deploy. Secondly, by default it automatically searches recursively, prints out the filename, and line numbers of matches. It also uses PCRE for its regexes which is really nice.

But by far the most time saving feature I have is the type searching functionality in it! For example, one can type 'ack --java System.out' and it will search ONLY the java files! No more 'find . -name *.java -exec grep -Hni System.out {} \;'. And you can add custom types easily through your .ackrc, it is a very well put together piece of software.

(PS: If you're trying it, definitely try out 'ack --bar')

Re:Programs that have saved me 100+ hours by curuinor on Thursday March 16, 2017 @11:56PM (#13891343)
If you mention ack, you gotta mention silver search (ag):

https://github.com/ggreer/the_silver_searcher

Re:Programs that have saved me 100+ hours by lloeki on Friday March 17, 2017 @05:55AM (#13892771)
If you mention the silver searcher (ag), you gotta mention the platinum searcher (pt) :)

https://github.com/monochromegane/the_platinum_searcher

Since it's pure Go, there's your static binary which makes it easily deployable again.

Re:Programs that have saved me 100+ hours by fanf2 on Saturday March 18, 2017 @09:21AM (#13901112)
If you mention ack, ag, and pt, you also have to mention ripgrep (rg) https://github.com/BurntSushi/ripgrep which has the usability features of the newer grep-alikes but is as fast or faster than gnu grep.
Re:Programs that have saved me 100+ hours by LaFolle on Friday March 17, 2017 @01:47AM (#13891820)
What is the difference between ack and ag? I use ag a lot, and it seems, on web, whenever ag is mentioned, ack is also somewhere in vicinity (or vice-versa).
Re:Programs that have saved me 100+ hours by curuinor on Friday March 17, 2017 @01:56AM (#13891866)
ag is faster ack is simpler and more OG
Re:Programs that have saved me 100+ hours by 9diov on Friday March 17, 2017 @12:09AM (#13891403)
You should try ripgrep (https://github.com/BurntSushi/ripgrep) which has the same functionality but with 2 orders of magnitude faster.
Re:Programs that have saved me 100+ hours by techwizrd on Friday March 17, 2017 @03:25AM (#13892205)
I used to use grep and ag quite often until I found ripgrep. It's really an incredible piece of software.
Re:Programs that have saved me 100+ hours by frenchie14 on Friday March 17, 2017 @12:40AM (#13891546)
> No more 'find . -name * .java -exec grep -Hni System.out {} \;'

While ack is great, I just want to point at you could easily do 'grep -rHni System.out --include \*.java'. Granted it's still more words, but the '--include' directive (which you can specify multiple of) is really great for quickly modifying a grep search to restrict to certain filetypes. No need for find/exec :)

Re:Programs that have saved me 100+ hours by LaFolle on Friday March 17, 2017 @01:52AM (#13891849)
(PS: and also 'ack --cathy')!