Created
December 4, 2015 22:18
-
-
Save awaxa/d1afc1b09f6a5adcb0b3 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| SOURCE='source' | |
| TARGET='target' | |
| for file in $(find $SOURCE -type f -name \*.txt) ; do | |
| filename="$(basename $file)" | |
| first="$(echo $filename | cut -c1)" | |
| mkdir -p $TARGET/$first | |
| mv -v $file $TARGET/$first/$filename | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment