Created
September 4, 2019 08:32
-
-
Save ManWithBear/280285dd7d3d92758ccd016c3f5e3fd9 to your computer and use it in GitHub Desktop.
Recursively move files from subfolders to current folder
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
Transforms: | |
./Notification/[email protected] | |
./Notification/Black.png | |
./Sign out/Black.png | |
./Sign out/[email protected] | |
To: | |
[email protected] | |
.Notification_Black.png | |
.Sign out_Black.png | |
.Sign [email protected] | |
To test it out: | |
find . -type f -exec bash -c 'file=${1#./}; echo mv "$file" "${file//\//_}"' _ '{}' \; | |
To perform: | |
find . -type f -exec bash -c 'file=${1#./}; mv "$file" "${file//\//_}"' _ '{}' \; | |
from: | |
https://unix.stackexchange.com/a/178056 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment