Skip to content

Instantly share code, notes, and snippets.

@sebmaynard
Last active Aug 29, 2015
Embed
What would you like to do?
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