Linux file name garbled conversion basic tutorial

  
 

Copy files from Linux to Windows or copy files from Windows to Linux. Sometimes Chinese file names are garbled. The reason for this problem is that Windows file name Chinese code defaults to GBK, and Linux defaults. The file name is encoded as UTF8. Due to inconsistent encoding, the file name is garbled. To solve this problem, the file name needs to be transcoded.

In Linux, a tool is provided to convert the file name encoding. You can convert the file name from GBK to UTF-8 encoding, or from UTF-8 to GBK.

The server is centos, install convmv:

yum -y install convmv.

Let's take a look at the specific usage of convmv:

convmv -f source encoding -t new encoding [options] filename

common parameters:

- r Recursively processing subfolders -r Recursively processing subfolders

–notest Really, please note that by default, the file is not actually manipulated, but only tested.

–list shows all supported encodings

–unescap can be escaping, such as turning %20 into a space

Copyright © Windows knowledge All Rights Reserved