Skip to content

Instantly share code, notes, and snippets.

@mminer
Created January 7, 2014 17:49
Show Gist options
  • Select an option

  • Save mminer/8303398 to your computer and use it in GitHub Desktop.

Select an option

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

mminer commented Jan 7, 2014

Copy link
Copy Markdown
Author

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

@mminer

mminer commented Nov 20, 2014

Copy link
Copy Markdown
Author

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