Citron/rename.sh
2024-12-31 16:19:25 +10:00

17 lines
421 B
Bash
Executable file

#!/bin/bash
# Define old and new strings
old="yuzu"
new="citron"
# Find and rename directories first
find . -depth -type d -name "*${old}*" | while read -r dir; do
newdir=$(echo "$dir" | sed "s/${old}/${new}/g")
mv "$dir" "$newdir"
done
# Find and rename files
find . -depth -type f -name "*${old}*" | while read -r file; do
newfile=$(echo "$file" | sed "s/${old}/${new}/g")
mv "$file" "$newfile"
done