How to get rid of bad chrs?
Ralf Mardorf
kde.lists at yahoo.com
Sun Aug 1 21:42:44 UTC 2021
On Sun, 1 Aug 2021 21:56:04 +0100, Colin Law wrote:
>On Sun, 1 Aug 2021 at 21:25, rikona <rikona at sonic.net> wrote:
>>
>> Just did a backup of new box and got many errors using grsync. Almost
>> all were because of 'bad' chrs in the file name ["?: etc]. Some names
>> have more than 1 bad chr. Is there a way to safely remove just this
>> set of chrs in every file name within a folder/subfolders, and leave
>> the rest of the chrs in the file name intact? (safely = no chance of
>> losing a file :-)
>
>grsync should not throw an error just because a file name contains
>unusual characters such as question mark. File names can contain any
>character except '/'. Are you sure that is what the problem is?
That's not correct for all file systems, see
https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits .
File systems might expect either NFC or NFD,
https://en.wikipedia.org/wiki/Unicode_equivalence#Example ,
http://manpages.ubuntu.com/manpages/focal/man1/convmv.1.html .
Btw. the ext4 file system allows "Any byte except NUL, /".
[rocketmouse at archlinux chars]$ /usr/bin/ls -l . ../backup/
.:
total 0
../backup/:
total 0
[rocketmouse at archlinux chars]$ touch \"\?\:
[rocketmouse at archlinux chars]$ /usr/bin/ls -l . ../backup/
.:
total 0
-rw-r--r-- 1 rocketmouse rocketmouse 0 Aug 1 23:20 '"?:'
../backup/:
total 0
[rocketmouse at archlinux chars]$ cp -a * ../backup/
[rocketmouse at archlinux chars]$ /usr/bin/ls -l . ../backup/
.:
total 0
-rw-r--r-- 1 rocketmouse rocketmouse 0 Aug 1 23:20 '"?:'
../backup/:
total 0
-rw-r--r-- 1 rocketmouse rocketmouse 0 Aug 1 23:20 '"?:'
[rocketmouse at archlinux chars]$
More information about the ubuntu-users
mailing list