I'm using Mac 10.9.1. I would like to create an alias for grep so that it won't print out messages like "grep: /Users/davea/workspace/myproject/subdir/: Is a directory" all the time. So in my terminal, I opened ~/.profile and entered
alias grep='grep -s'
However, when I close and re-open my terminal and then enter
find ~/workspace/myproject/ -type f -exec grep 'mytoken' {} \;
Try using the full power of find. -type f restricts the search to regular files, so it excludes directories. The "*" is not needed because find looks at all files by default. if you wanted filenames that end in dat, then -name '*dat' would be required.
Thanks, although my question has less to do with find and more to do with why the grep alias isn't working. Do you know why that is? I just used the find as an example, but maybe I should dig up another example that doens't involve find so as not to distract from the problem.