4 ms·
grep -r . "some random debug message" (searches for the passage recursively in all files from the directory it was executed, the main reason I like developing i
by tlarkworthy 14y ago
grep -r . "some random debug message"
(searches for the passage recursively in all files from the directory it was executed, the main reason I like developing in linux more than windows)
- jlgreco 14y agoIf you are searching inside code specifically, you may like 'ack'. It does the same thing grep does, except it has preset 'excludes', is recursive by default, and the output is a bit prettier.
- tlarkworthy 14y agoOh thanks! I will give it a whirl
- lachenmayer 14y agoOr even 'ag' (the silver searcher). Like ack, but "better". https://github.com/ggreer/the_silver_searcher https://github.com/ggreer/the_silver_searcher
- crazydiamond 14y ago"better" or just faster since its written in C ? It is not a drop-in replacement for ack. e.g. there are some basic usages it does not support -- iirc counts (ag -c pattern).
- jlgreco 14y agoEh, faster is faster, does it matter why?
- crazydiamond 14y agoThe part about written in C was just added on. My point was "better or faster". If you say "faster is better" I'll have to agree :)
- pacaro 14y agoOn windows findstr /SPINC:"some random debug message" * Will do the same. FINDSTR is no grep, but for very simple cases like this is just fine SPINC and SPIMC are my favorite options...
- alexkus 14y agogrep -rs or (more commonly for me):- grep -rsi (The -s supresses errors about unreadable files that may clutter the output. -i for case insensitivity.)