Skip to content

Instantly share code, notes, and snippets.

@Flushot
Last active December 18, 2015 12:49
Show Gist options
  • Select an option

  • Save Flushot/5785800 to your computer and use it in GitHub Desktop.

Select an option

Save Flushot/5785800 to your computer and use it in GitHub Desktop.
Recursively greps a directory, omitting specified files and subdirectories.
#!/bin/sh
find -x . \
-type d \( \
-path ./.git -o \
-path ./logs -o \
-path ./temp \
\) -prune -o \
-exec grep -snH "$1" {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment