Created
April 13, 2017 14:32
-
-
Save blahah/c2e29a5c3b805370c556237ab4b1da3b to your computer and use it in GitHub Desktop.
unnest nested dirs
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
| for path in $(find ../articles_split/articles/ -type d -wholename '*\/*\/*\/*\/*' | grep '.\{36\}'); do | |
| mergeddir=$(echo $path | sed 's/\([0-9]\)\/\([0-9]\)\/\([0-9]\)\/\([0-9]\)\/\([0-9]\)/\1\2\3\4\5/') | |
| mkdir -p $mergeddir | |
| cp -R $path/* $mergeddir/ | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment