Last active
May 22, 2020 12:51
-
-
Save serayuzgur/28aa37ccbebe5385ffc50ed151778dfa 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
# copy this to .zshrc or similar place. usage 'flatten x' x is the directory to traverse and flatten | |
flatten() { | |
find $1 -mindepth 2 -type f -exec mv -f {} $1 ';' | |
find $1 -mindepth 1 -type d -exec rmdir {} ';' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment