Snippet Library
Browse | Submit A New Snippet | Create A Package
grep within sources | |
| Type: Function |
Category: Searching |
| License: GNU General Public License |
Language: Unix Shell |
| Description: grep code line thru a source code file hierarchy, by avoiding .svn, *~, ... but keeping the nice colors of grep. Add to .bashrc or source in you shell when useful. See also ack-grep. | |
Versions Of This Snippet:
| Snippet ID | Download Version | Date Posted | Author | Delete |
|---|---|---|---|---|
| 21 | 1.0 | 2008-09-05 23:07 | Pierre Neyron |
Download a raw-text version of this code by clicking on "Download Version"
Latest Snippet Version: 1.0
sgrep() { find ${2:-.} -path "*svn*" -prune \ -o -path "*~" -prune \ -o -path "*.swp" -prune \ -o -exec grep --color=auto -H "$@" {} \; }
Submit a new version
You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..

