nanofur/script

13 lines
441 B
Text
Raw Permalink Normal View History

2024-12-13 21:02:24 +01:00
#!/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!"