Created
May 7, 2019 23:53
-
-
Save airicbear/0f93e32a24e92c151da04ca605734400 to your computer and use it in GitHub Desktop.
Rename files in subdirectories to DIRECTORYNAME-SUBDIRECTORYNAME-FILENAME
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 D in *; do | |
if [ -d "${D}" ]; then | |
for F in $D/*; do | |
mv $F ${PWD##*/}-${D##*/}-${F##*/} | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment