Use convmv encoding and conversion in centos

Source: Internet
Author: User
Today we will introduce a file name transcoding tool-convmv. convmv helps us easily encode and convert all files in one file and directory, such as converting gbk to utf8. Install yuminstallconvmv syntax: convmv [options] FILE (S)... DIRECTORY (S) main options: 1.-fENCODING specifies the encoding of the current FILE name, such as-f

Today we will introduce a file name transcoding tool-convmv. convmv helps us easily encode and convert all files in one file and directory, such as converting gbk to utf8.
Install yum install convmv

Syntax:
Convmv [options] FILE (S)... DIRECTORY (S)
Main options:
1.-f ENCODING
Specifies the encoding of the current file name, such as-f gbk.
2.-t ENCODING
Specifies the encoding to be converted to, such as-f UTF-8.
3.-r
Recursively convert all file names in the directory
4. -- list
List all supported codes
5. -- notest
By default, only the converted effect is printed. this option is used to perform the conversion operation.
 

Common parameters:-r recursively processes subfolders-notest to perform real operations. by default, files are not actually operated.-list displays all Supported encodings-unescap can be escaped, for example, to change % 20 to space-I interaction mode (ask every conversion to prevent misoperation) convmv usage: convmv-f source code-t new encoding [option] file name example: after this conversion, the "GBK encoded file name" will be converted to UTF-8 encoding (only the conversion of file name encoding, the file content will not change ). Note: Do not use this command in the NTFS and FAT file systems. otherwise, unexpected results may occur. if you want to correctly display the NTFS and FAT file names in Linux, the mount parameter can be used to solve the problem. For more information, see the man manual.

Example:
Recursive conversion the current file name under the centos directory is encoded as gbk UTF-8:

  1. Convmv-f gbk-t UTF-8 -- notest-r centos
2. Sample Code: convmv-f GBK-t UTF-8 -- notest-r 303i.com/* (303i.com/when is the current directory of the file to be converted)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.