Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- svn ls -R | xargs -d 'n' grep <string-to-search-for>
- s () {
- local PATTERN=$1
- local COLOR=$2
- shift; shift;
- local MOREFLAGS=$*
- if ! test -n "$COLOR" ; then
- # is stdout connected to terminal?
- if test -t 1; then
- COLOR=always
- else
- COLOR=none
- fi
- fi
- find -L .
- -not ( -name .svn -a -prune )
- -not ( -name templates_c -a -prune )
- -not ( -name log -a -prune )
- -not ( -name logs -a -prune )
- -type f
- -not -name *.swp
- -not -name *.swo
- -not -name *.obj
- -not -name *.map
- -not -name access.log
- -not -name *.gif
- -not -name *.jpg
- -not -name *.png
- -not -name *.sql
- -not -name *.js
- -exec grep -iIHn -E --color=${COLOR} ${MOREFLAGS} -e "${PATTERN}" {} ;
- }
- # s foo | less
- sl () {
- local PATTERN=$*
- s "$PATTERN" always | less
- }
- # like s but only lists the files that match
- smatch () {
- local PATTERN=$1
- s $PATTERN always -l
- }
- # recursive search (filenames) - find file
- f () {
- find -L . -not ( -name .svn -a -prune ) ( -type f -or -type d ) -name "$1"
- }
Add Comment
Please, Sign In to add comment