Linux Optimization Basics Change "character Set"

Source: Internet
Author: User
Tags locale

Younger brother's first Linux blog, I hope you pass the heroes can leave valuable advice, if you can point out where the younger brother is not even wrong to write it better!!! The younger brother will immediately correct and deep record! Thank you for all the great gods who clicked.



Main content: Modify the character set you want


Application environment: Solve garbled characters


Related commands:

$LANG: variable of Character set

Locale: View the currently set language

-A: View supported languages

Vi/vim: Text editing software vim needs download Download command is: Yum install vim-y

Export: command to change variables

Source: Make variables effective immediately after modification

/etc/Directory: Configuration files for hosts and systems

Profile: Environment variable settings that will run each time the user logs on

locale.conf file: The location of the CENTOS7 character set file

The location of the file in the SYSCONFIG/IL8N:CENTOS6 character set

Su-[username]: Switch User Su-[blank or root]: switch to root

Switch to another user to see if the global is in effect


Specific operation:

It's cetnos7.

1) modifying configuration files and environment variables

[Email protected] ~]# locale

Lang=en_us. UTF-8

Lc_ctype= "en_US. UTF-8 "

Lc_numeric= "en_US. UTF-8 "

... more ......

Lc_identification= "en_US. UTF-8 "

Lc_all=

[[email protected] ~]# date

Sat Jul 16:40:13 CST 2016

#可以看到目前所设置的语系为en_US (American English?) ) plus the-a (all) parameter to see the languages that can be set


[Email protected] ~]#vim/etc/locale.config

Lang= "en_US. UTF-8 "#<--The character sets currently set by the system


Lang= "ZH_CN. UTF-8 "#<--modified character Set


[Email protected] ~]# export lang= "ZH_CN. UTF-8 "

#更改环境变量LANG


2) The settings are well checked.

[Email protected] ~]# cat/etc/locale.conf

Lang= "ZH_CN. UTF-8 "

#检查字符集所在文件 is to modify the content to remember that the CENTOS6 file is/etc/sysconfig/il8n


[Email protected] ~]#echo $LANG

Zh_cn. UTF-8

#检查环境变量 's already been modified.


[[email protected] ~]# date

Saturday, July 16, 2016 16:44:39 CST

#可以看到已经是中文啦


[Email protected] ~]# su-linuxgod

Last Login: 67 months 16:38:35 CST 2016pts/0

[Email protected] ~]$ Su-

Password:

Last Login: 67 months 16:38:50 CST 2016pts/0

#别的用户也已经是中文了

This article is from the "haremking" blog, make sure to keep this source http://yzplinux.blog.51cto.com/10161425/1826998

Linux Optimization Basics Change "character Set"

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.