Windows friendly Linux file copy

Welcome to Programming Tutorial official website. Today - we are going to cover how to solve / find the solution of this error Windows friendly Linux file copy on this date .

In Linux, how can I recursively copy files and directories in such a way that all of the copied files and directories will have a name that windows can handle?

I want to copy a folder into a shared directory or USB device that uses Windows file name restrictions, without failing or losing any files/folders (prefer to change name rather than to lose data).

Answer

Some ideas from the post
copy filenames with special characters to an external ntfs volume:

  • Use detox
    to clean up special characters in filenames.

  • Mount the NTFS filesystem so it cleans up (sanitizes) the file names by itself.
    The mount option to enable this is windows_names.
    See man ntfs-3g.

  • Use
    rsync
    to change filenames to fit the destination filesystem with the parameter
    --iconv=CONVERT_SPEC, to request charset conversion of filenames.