Created
March 30, 2024 03:57
-
-
Save msimerson/10da36288e12dab179cc1226ebbf184a to your computer and use it in GitHub Desktop.
gfind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gfind() { | |
find -E . \ | |
-type d -regex '.*\.(git|svn|blib|build)$' -prune -o \ | |
-type f -name '*.min.js' -prune -o \ | |
-type d -name node_modules -prune -o \ | |
-type d -name bower_components -prune -o \ | |
-type d -name vendor -prune -o \ | |
-type d -name coverage -prune -o \ | |
-type d -name ignore -prune -o \ | |
-type d -name _site -prune -o \ | |
-type d -name bats -prune -o \ | |
-type d -name test_helper -prune -o \ | |
-type f -regex '.*~' -prune -o \ | |
-type f -iregex '.*\.(jpeg|jpg|gif|pdf|png|gz|tgz|zip|mov|mp4|m4a|pages)$' -prune -o \ | |
-type f -print | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also have an older
sfind
version of it that excludes .svn (subversion) metadata. Since I mostly use this shell command for grepping file contents (grep PATTERN `gfind`), excluding binary file types is also useful.