Skip to content

Instantly share code, notes, and snippets.

@bonicim
Created June 14, 2023 20:19
Show Gist options
  • Select an option

  • Save bonicim/b27cf5655c313fb67f2853a684f2bf47 to your computer and use it in GitHub Desktop.

Select an option

Save bonicim/b27cf5655c313fb67f2853a684f2bf47 to your computer and use it in GitHub Desktop.
Process directories using bash
# Form
# ls -d <directory>/* | xargs -I {} bash -c "<some command> '{}'"
# example: Goes through each directory and runs git fetch on each one
ls -d core/* | xargs -I {} bash -c "cd '{}' && printf 'Processing repo {} \n' && git fetch stash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment