nanofur/script
2024-12-13 20:05:31 +00:00

12 lines
441 B
Bash

#!/bin/bash
# Find all files containing "nanofur" (case-insensitive) in the current directory and subdirectories
find . -type f -iname '*nanofur*' | while read -r file; do
# Construct the new file name by replacing "nanofur" with "nanofurfur" (case-insensitive)
new_file=$(echo "$file" | sed -E 's/[Nn][Aa][Nn][Oo]/nanofurfur/g')
# Rename the file
mv "$file" "$new_file"
done
echo "Renaming complete for all directories!"