1

I am running a QNAP system and I am trying to move a huge music library from one server to another.

Unfortunately many .mp3 files and folder names contain � (U+FFFD REPLACEMENT CHARACTER) instead of the original hyphen ('). This is probably due to an old transfer I did many, many years ago.

The problem is that the move (to a CFS/SMB folder) is aborted and I need to open a shell and manually rename the file/folder to take out that special character.

On qnap (limited) shell I see the name file for example as:

    Eric Clapton�s Concert/Knockin� Heavens Door.mp3

I want to avoid to manually rename each file.

I have found many suggestions/examples, but none with this special character (which I do not know how to refer to).

Jens
  • 69,818
  • 15
  • 125
  • 179
giopas
  • 645
  • 1
  • 6
  • 10
  • check https://stackoverflow.com/questions/8562354/remove-unicode-characters-from-textfiles-sed-other-bash-shell-methods – P.... Dec 14 '16 at 10:00
  • Thank you but I don't know how to apply it to a full set of subfolder and files. – giopas Dec 14 '16 at 10:02
  • check `find` with `sed` – P.... Dec 14 '16 at 10:03
  • @PS. What about this? `find . -name "*[?]*" -exec sh -c 'x="{}"; y=$(sed "s/[?]\+/-/g" <<< "$x") && mv "$x" "$y" ' \;` (modified from http://stackoverflow.com/questions/19008614/find-files-with-illegal-windows-characters-in-the-name-on-linux) – giopas Dec 14 '16 at 16:30
  • @PS. It did not. maybe I am missing something here. Any advice? – giopas Dec 14 '16 at 16:50

0 Answers0