Skip to content

recursive removing special chars in filesystem with most similar alphanumerics

License

Notifications You must be signed in to change notification settings

othmar52/clean-rename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

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

About

recursive removing special chars in filesystem with most similar alphanumerics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages