I'm currently moving content from an old xServe to a Synology NAS and the client decided 10 years ago to add one or more spaces before filenames and folders to make them appear higher up in the tree. When moving everything to the Synology NAS we're getting a lot of errors because of this.
The ideal solution for me would be to have a script that removes only the space(s) before the name and keeps the rest.
I found another similar thread here but that removes any space regardless of where it is found in the name. The script from the other thread is
find /tmp/ -depth -name "* *" -execdir rename 's/ /_/g' "{}" \;
Does anyone have an idea?
Thank you!