Skip to content

Instantly share code, notes, and snippets.

@mminer
Created January 7, 2014 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mminer/8303398 to your computer and use it in GitHub Desktop.
Save mminer/8303398 to your computer and use it in GitHub Desktop.
Performs a recursive grep search, looking only at Python files. The first argument is the search string, the second on is the directory to search through. Handy when aliased to a command like "searchpy".
#!/bin/bash
grep -r --include='*.py' "$1" ${2:-.}
@mminer
Copy link
Author

mminer commented Jan 7, 2014

This could be trivially modified to search any given file type, I just happen to do a lot of searching through Python files.

@mminer
Copy link
Author

mminer commented Nov 20, 2014

I no longer use this; Ack has replaced Grep as my search tool of choice.

ack --python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment