How to set the Chinese language of the Linux system? This is a problem that many friends will encounter when they start using Linux. When the terminal input command is echoed, the Chinese text displays garbled characters. This situation usually occurs because the Chinese language pack is not installed, or there is a problem with the default language set. Taking centos as an example, how to check the language, set and modify the language when operating Linux
1. Check the current system language
After logging in to the Linux system and opening the operating terminal, enter echo $LANG to check the currently used system language. Such as
2. Check the installed language pack
To see if there is a Chinese language pack, you can enter the locale command in the terminal. If there is zh cn, it means that the Chinese language has been installed
3. What if there is no Chinese language?
You can download and install the Chinese language package yum groupinstall chinese-support from the Internet
After installation
Enter the locale command
4. How to modify the system language to Chinese
1 Temporarily change the language
If To temporarily change the language environment of the Linux system, you can set LANG=language name by inputting it, such as zh_CN.UTF-8 for Chinese
2. Modify the system default language
The above method is to set the system default language configuration by modifying
such as vi /etc/sysconfig/i18n (Be careful to restart the system after making the changes)
5. Other notes
If it still doesn’t work to modify and set the Chinese language according to the above method, pay attention to the encoding selected by your link terminal.
Take xshell as an example, select Chinese or UTF8 as the terminal encoding
More Linux Chinese display garbled characters? For related articles on how to set centos to display Chinese, please pay attention to the PHP Chinese website!