Menü schliessen
Created: October 19th 2013
Last updated: May 6th 2022
Categories: Linux
Author: Marcus Fleuti

Linux bash: Convert filenames recursively from ISO-8859-1 (or other) to UTF-8 and vice versa

Tags:  bash,  Convert,  convmv,  ISO,  ISO-8859-1,  Linux,  UTF-8
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC
Information
This article explains the basic usage to convert ISO to UTF-8 charsets. If you are searching for a sophisticated script check out this page also:

Convert filenames from ISO → UTF-8

convmv -f iso-8859-1 -t utf8 -r ./*

[ this command just shows you what it would do. To actually apply the conversion add the parameter --notest ]

Convert filenames from UTF-8 → ISO

convmv -f utf8 -t iso-8859-1 -r ./*

[ this command just shows you what it would do. To actually apply the conversion add the parameter ‐‐notest ]

Details explained

  • convmv: A tool you might need to download and install first. (in Debian enter this on your console: aptitude install convmv)
  • parameter "-f" : convert from charset XYZ (see man convmv)
  • parameter "-t": convert to charset XYZ (see man convmv)
  • parameter "-r": convert recursively (all files in all subdirectories)
  • parameter "./*": start conversion in the current directory. You may enter a target directory here like /home/myroot/myfiles
  • parameter "‐‐notest": apply this to actually start the conversion. Without it the command will just show what it would do