I have a bunch of files spread over a lot of folders in an ext4 disk. Some of those files have illegal characters for ntfs (like :
or |
) and so I get errors when I try to copy them to be seen in Windows.
Is there any tool that will let me copy the files and change the names as needed, or do I need to write my own?
Check this answer: https://superuser.com/questions/178025/linux-copy-to-fat32-filesystem-invalid-argument
In short, install
pax
:Now instead of doing:
to copy a directory tree, you can instead run:
This way
pax
will rename only the copies of the files when necessary.Each
*
or?
or:
character will be replaced with a_
character automatically. This means it is potentially possible that multiple files will receive the same new name.