Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the character set by linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to modify the linux character set, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

Methods: 1, use "LANG= character set" or "export LANG= character set" command to temporarily modify character set; 2, use "vi / etc/sysconfig/i18n" command to modify character set configuration file to modify character set permanently.

The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to modify the character set of linux 1. View the character set method of the current linux system

1.1 、 locale

1.2, echo $LANG

1.3, env | grep LANG

Second, view the character sets supported by the current system

[root@localhost] # locale-a

Third, modify the system character set

Temporary effective # for example, the character set is modified to: zh_CN.gb2312

You can see that the system character set has been changed from the original en_US.UTF-8 to zh_CN.gb2312, but restart the system or reopen a shell

The character set is still the original character set, that is, en_US.UTF-8

3.2. permanent effect # # for example, if the character set is changed to zh_CN.gb2312, restart the system and reopen shell, it will not be invalidated

Cat / etc/sysconfig/i18n # View character set configuration file

Vi / etc/sysconfig/i18n # en_US.UTF-8 is modified to zh_CN.gb2312

Source / etc/sysconfig/i18n # # takes effect immediately. If you check the character set, it has become the modified

The above is all the contents of the article "how to modify the character set of linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report