Created
April 9, 2013 14:35
-
-
Save a1phanumeric/5346170 to your computer and use it in GitHub Desktop.
Grep exclusions. Demonstrates how to exclude multiple directories, and files.
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
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" . |
Awesome, Thanks!
This works both on Mac OS and Linux :)
# --color: highlight matched string
# -r: recursive search
# -i: ignore case
# --exclude: exclude specified files
# --exclude-dir: exclude specified dir
grep --color -r -i "foo\|bar" --exclude={\*.csv,\*.txt} --exclude-dir={.git,.idea,vendor} .
muchos gracias.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gold! thanks buddy!