4 ms·
You probably want to time against fgrep (grep -F). When you're searching for simple strings, it's often faster than the regex grep.
by holygoat 18y ago
You probably want to time against fgrep (grep -F). When you're searching for simple strings, it's often faster than the regex grep.
- SwellJoe 18y agoMinor difference: $ time find * -name '.svn' -prune -o -type f -exec fgrep joe \{\} + real 0m0.365s user 0m0.162s sys 0m0.183s But that opens up another can of worms--at least 50% of the time, I'm looking for something more complex (sometimes I'll search for the haystack first using a string, and then switch to a regex to find the needle once I know roughly what I'm looking for). From a productivity standpoint, I think just always using one (probably ack since its output is more readable, though I tend to use grep unless I think, since I haven't been using ack for very long, and ten years of habitual grepping is a habit that dies hard).