I want to strip filenames recursively that have multiple dashes, so that file---name-3.jpg becomes file-name-3.jpg. This works fine within a single folder but I would like to move into the parent folder, and run the command. It also works fine until it runs into a folder name that also has multiple dashes, and then it tries to rename them.
find . -type f -iname '*---*' -depth -exec rename 's/---/-/gi' {} +
parent_folder
\sub--folder-1
file--name-1.jpg <-- rename file-name-1.jpg
file----name-2.jpg <-- rename file-name-2.jpg
\sub----folder-2
file--name-1.jpg <-- rename file-name-1.jpg
edit using bash on a CentOS server