I have few directories whose names looks like the following:
I want to remove the newline from the end recursively.
I checked Recursively rename directories
I also checked Remove newlines in file names
The solution it suggests is:
find -name $'*\n*' -exec rename $'s|\n| |g' '{}' \;
But in my case find -name $'*\n*' returns nothing. If I remove the $ it can find the directories
% find . -name '*\n*'
./second?
% find . -name '*\r*'
./third?
./first?
However, when I run find . -name '*\n*' -exec rename $'s|\n| |g' '{}' \; it does not rename the directory. I also tried find . -name $'*\n*' -exec rename $'\n' ' ' {} \; from Recursively remove newline in file names. It is also not renaming the directories.
What can I do?
