Created
May 2, 2016 19:25
-
-
Save enriched/0e4e0231ae650343d3191f12b9562ef5 to your computer and use it in GitHub Desktop.
Bash for each directory in current folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you can add this little gem to your .bash_profile to run a command inside of each directory in the current folder | |
# eg: foreachdir 'git status' | |
foreachdir() { /usr/bin/find . -type d -mindepth 1 -maxdepth 1 -exec sh -c "(cd {} && echo '\033[0;31m// '\$PWD'------>\033[0m' && $1)" ';' ; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment