Created
July 30, 2015 13:09
-
-
Save jacyzon/41778fb514e20bfd98c0 to your computer and use it in GitHub Desktop.
flatten a nested directory
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
| # Using ZSH | |
| mv dir1/*/**/*(.D) dir1 | |
| # Using POSIX Tool | |
| find dir1 -type f -exec mv {} dir1 \; | |
| find dir1 -depth -exec rmdir {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment