3 ms·
Not that I have anything against The Silver Searcher, but I've been using the following script I wrote for years, and it is even faster than ag from my very rec
by nessus42 14y ago
Not that I have anything against The Silver Searcher, but I've been using the following script I wrote for years, and it is even faster than ag from my very recent limited experience:
#!/bin/sh -u
dir="$1"
shift
# This doesn't work unless we have GNU find (for the -xtype option):
gfind "$dir" \
\( -type f -or -xtype f \) \
\( -name "*.[ct]xx" \
-or -name "*.[CchH]" \
-or -name "*.py" \
-or -name "*.java" \
-or -name "*.scala" \
-or -name "*.pde" \
-or -name "*.js" \
-or -name "*.xml" \
\) \
-print0 \
| xargs -0 egrep ${1+"$@"}