Skip to content

Instantly share code, notes, and snippets.

@ishu3101
Created April 11, 2017 03:51
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 ishu3101/8a5d8fc7070b2a662b92398c5a4acb03 to your computer and use it in GitHub Desktop.
Save ishu3101/8a5d8fc7070b2a662b92398c5a4acb03 to your computer and use it in GitHub Desktop.
Find all the git repository inside a directory.
find . -name .git -type d -exec dirname {} \;
  • . specifies the path to search.
  • -type d makes this only apply to directories.
  • -name ... specifies the name of the directories this should apply to.
  • -exec ... {} + is the command that will be run for each match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment