I used the following command for grep for a string in all python source files in and below my current directory:
find . -name '*.py' -exec grep -nHr <string> {} \;
I would like to simplify everything so that I can just type something like
findpy <string>
And get the same result. The aliases do not seem sufficient, as they only build the extension, and the argument I need to specify is not the last argument. Functions seem to be suitable for the task, so I have a few questions:
- How do i write?
- Where can I put it?
source
share