Skip to content

Instantly share code, notes, and snippets.

@sebmaynard
Last active August 29, 2015 14:01
Show Gist options
  • Save sebmaynard/5604595ba606d28548a9 to your computer and use it in GitHub Desktop.
Save sebmaynard/5604595ba606d28548a9 to your computer and use it in GitHub Desktop.
A fast, simple find/grep wrapper targetted at Erlang projects
#!/bin/bash
# speed things up quite a lot!
export LC_ALL=C
# uses -P (perl regular expressions) for speed
find ./ -type f ! \
-path "*/deps/*" ! \
-path "*/caerldeps/*" ! \
-path "*/_rel/*" ! \
-path "*/log/*" ! \
-path "*.beam" ! \
-path "*.dtl.erl" ! \
-path "*/.eunit/*" ! \
-path "*.tbl" ! \
-path "*.jar" ! \
-path "*.deps_plt" ! \
-path "*.sys_plt" ! \
-path "*/erl_crash.dump" ! \
-path "*.dll" ! \
-path "*/notes.html" ! \
-path "*/target/streams/*/out" -print0 | xargs -P 4 -0 grep "$@" -P -nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment