https://github.com/othmar52/clean-rename
recursive removing special chars in filesystem with most similar alphanumerics
https://github.com/othmar52/clean-rename
Last synced: 4 days ago
JSON representation
recursive removing special chars in filesystem with most similar alphanumerics
- Host: GitHub
- URL: https://github.com/othmar52/clean-rename
- Owner: othmar52
- License: mit
- Created: 2016-02-14T09:19:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-16T07:40:54.000Z (over 10 years ago)
- Last Synced: 2023-08-26T20:51:31.139Z (almost 3 years ago)
- Language: Shell
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clean-rename
recursive replacing special chars in UNIX-UTF8-filesystem with most similar alphanumerics in filenames and directorynames
Špêçïål ©harš in filesÿsteμ/$ù¢κš.e×t -> Special_chars_in_filesystem/Sucks.ext
# demo
create testdirectory and testfile
~/othmar52/clean-rename $ mkdir -p "/tmp/clean-rename-demo/Špêçïål ©harš in filesÿsteμ"
~/othmar52/clean-rename $ touch "/tmp/clean-rename-demo/Špêçïål ©harš in filesÿsteμ/$ù¢κš.e×t"
run clean-rename
~/othmar52/clean-rename $ ./clean-rename /tmp/clean-rename-demo
/tmp/clean-rename-demo/Špêçïål ©harš in filesÿsteμ/$ù¢κš.e×t ---> /tmp/clean-rename-demo/Špêçïål ©harš in filesÿsteμ/Sucks.ext
/tmp/clean-rename-demo/Špêçïål ©harš in filesÿsteμ ---> /tmp/clean-rename-demo/Special_chars_in_filesystem
0 errors
show result
~/othmar52/clean-rename $ find /tmp/clean-rename-demo -type f
/tmp/clean-rename-demo/Special_chars_in_filesystem/Sucks.ext
# troubleshooting
in case the result from the example above looks like this `Yapaeacaiaal_eharYa_in_filesaysteu/SauauYa.eat` you have to make sure your session is UTF-8. one way to achieve this is to add following lines to your `~/.bashrc`
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8