Last active
December 2, 2020 14:30
-
-
Save organom/ae1e1d4f4a3c884fcfa6a73859c773af to your computer and use it in GitHub Desktop.
Flattern folder and file structure by extension, files will be moved to the current folder with the name being $DIR-$FILENAME.EXTENSION
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
EXTENSION=hl7 | |
find . -type f -name "*.$EXTENSION" -printf "/%P\n" | while read FILE ; do DIR=$(dirname "$FILE" ); NAME=$(basename "$FILE" ); mv ."$FILE" ."$DIR-$NAME".$EXTENSION; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment