I am trying to move some files from ubuntu to my MacOS machine.

I am copying the files like this: ubuntu -> NTFS hdd -> MacOS machine.

When I connect the hdd to Mac, and I open some folders (in Finder), I find that some files are missing (due to inappropriate namings like ':').

When I copy the files to MacOS from terminal using the command rsync -avh it gives me some messages in the beginning: "file has vanished: [file path]" (the file path includes the files with unacceptable names).

Does anyone have an idea how to avoid these errors please?


Rename files at source by doing this:

find -depth -type d | \ while read x; \ do cd "$x"; \ for file in *; \ do mv -inv "$file" "$(echo "$file" | sed -e 's/[^-A-Za-z0-9(),+!_ .]/_/g')"; \ done; \ cd -; \ done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy