How to adjust the character set to Chinese in Linux

Source: Internet
Author: User

First switch to the root user via the SU command

Check what the current character set is and implement it through the Echo $LANG

Of course, you can also check your system's files with the cat command:/etc/sysconfig/i18n

But I think it is very strange, centos7 above this file, and then an analysis, the original is 7 version put Lang into another file:/etc/locale.conf, everyone notice

Of course, in modifying the configuration file, to develop a good habit, that is, backup.

Back up with the CP command:

Cp/etc/locale.conf/etc/locale.conf.ori

Then write the things we need with the echo command:

Echo ' lang=en ' >/etc/locale.conf

Check with cat command:

Cat/etc/locale.conf

The discovery file has been modified.

But through the Echo $LANG check for real-time status Discovery or Chinese, why?

In fact, there is no writing to the execution of things, often we can through the source or. command to execute the modified file (can be understood as a function of the update)

Note that the. is also the command, to follow the following/keep a space, so as not to error.

Check again, Echo $LANG and find out what we want.

Mutual encouragement, beginning of spring.

How to adjust the character set to Chinese in Linux

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.