Skip to content

Instantly share code, notes, and snippets.

@JamesSkemp
Last active January 29, 2020 19:47
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 JamesSkemp/86cc0caf64b27e1207d4eb52b317bf4f to your computer and use it in GitHub Desktop.
Save JamesSkemp/86cc0caf64b27e1207d4eb52b317bf4f to your computer and use it in GitHub Desktop.
Use built-in Windows functionality to find a string of text in a directory.
# Can only be run within a Git repository, but this will also search untracked files, as well as those that are tracked.
git grep --untracked '<term>'
REM From https://stackoverflow.com/a/13799990/11912
findstr /s "<term>" *.item
Get-ChildItem -Recurse -Include *.item | select-string "<term>"
gci -r -i *.item | select-string "<term>"
gci -r -i *.* -exclude *.dll,*.xml | select-string "<term>"
@JamesSkemp
Copy link
Author

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