Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  alias search='set -f;search';search() { find . ${2:+-name "$2"} -type f -print0 | xargs -0 grep --color=auto "$1"; }

Recursively searches the files in the current directory for string matches. You can optionally provide a second glob argument to restrict what files to search. This is basically a dumber version of ack-grep, but I wrote it before I learned about ack.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: