hippofish/rename.sh

14 lines
341 B
Bash
Raw Normal View History

2023-07-15 23:21:17 +02:00
#!/bin/bash
# Change directories
find . -type d -name '*calckey*' | while read dir; do
newdir=$(echo "$dir" | perl -pe 's/calckey/firefish/g')
mv "$dir" "$newdir"
done
# Change files
find . -type f -name '*calckey*' | while read file; do
newfile=$(echo "$file" | perl -pe 's/calckey/firefish/g')
mv "$file" "$newfile"
done