Skip to content

Instantly share code, notes, and snippets.

@Jahhein
Last active February 22, 2020 04:47
Show Gist options
  • Select an option

  • Save Jahhein/39f21cd2fe185209bbafbd413132e2a9 to your computer and use it in GitHub Desktop.

Select an option

Save Jahhein/39f21cd2fe185209bbafbd413132e2a9 to your computer and use it in GitHub Desktop.
Find all repositories under a directory.
#!/bin/bash
cat << EOF
1) find "$1" -name \"^.git$\" -print
2) gfind "$1" -name \"^.git$\" -print
3) sudo fd --hidden --no-ignore --type directory \"^.git$\" "$1"
pick one you can use.
## EXAMPLE
sudo fd --hidden --no-ignore --type directory \"^.git$\" ~/Unorganized-stuff >> ~/Desktop/repos-list.txt
EOF
exit 0
#!/bin/bash
# Lists all .git directories (repos) found in directory arg $1
sudo fd --hidden --no-ignore --type directory "^.git$" "$1"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment