Created
July 1, 2016 06:38
-
-
Save cab404/6f6565e3774a7df5fb9ee037633e05db to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
IFS=$'\n'; | |
echo "Moving tree to temporary folder" | |
for A in $(find -type f); do | |
mkdir -p .resort/$(dirname $A); | |
mv "$A" ".resort/$A"; | |
done | |
echo "Restoring tree structure, applying sorting" | |
cd .resort; | |
for A in $(find -type f | sort); do | |
mv "$A" "../$A"; | |
done | |
rm -rf .resort; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment