Skip to content

Instantly share code, notes, and snippets.

@Wind010
Last active February 23, 2020 03:39
Show Gist options
  • Save Wind010/5eadb1974af5ea84b1bb92dec3c24f35 to your computer and use it in GitHub Desktop.
Save Wind010/5eadb1974af5ea84b1bb92dec3c24f35 to your computer and use it in GitHub Desktop.
Run command in all sub-directories in current directory
for dir in */; do (cd "$dir" && <your_cmd_here>); done
#For example could be a git command.
#for dir in */; do (cd "$dir" && git pull); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment