Re:Useful Unix commands for exploring data
by unhammer on Wednesday August 27, 2014 @01:38PM
(#8233454)
ag is often faster when you're using it interactively, replacing "grep -r" (in particular in version controlled dirs). It's also faster in the sense that for interactive use it will often DWYM.
But has too many weird quirks that it can replace grep for data munging. E.g.
$ ag verb fullform_nn.txt >/tmp/verbs
ERR: Too many matches in fullform_nn.txt. Skipping the rest of this file.
Man ag says there's a --max-count option. Let's try that. $ grep -c verb fullform_nn.txt
206077
$ ag --max-count 206077 verb fullform_nn.txt >/tmp/verbs
ERR: Too many matches in fullform_nn.txt. Skipping the rest of this file.
Wtf? (and running those two commands with "time" gave ag user 0m0.770s while grep had user 0m0.057s)
Re:Useful Unix commands for exploring data
by andreasvc on Wednesday August 27, 2014 @03:03PM
(#8234080)
Did you report it as a bug?
Re:Useful Unix commands for exploring data
by unhammer on Thursday August 28, 2014 @07:32AM
(#8236719)
did now https://github.com/ggreer/the_silver_searcher/issues/483
(though it took me a while to figure out a more precise issue title than "--max-count is taunting me")
One liner shell commands often turn complicated quickly.