设为首页 收藏本站
查看: 398|回复: 0

[经验分享] CentOS / RHEL7 locale的使用

[复制链接]

尚未签到

发表于 2018-4-27 14:02:52 | 显示全部楼层 |阅读模式
The system localeare used to control the language setting of system services and the UI before the user logs in. How Do I change the default system locale in CentOS 7 linux system? How to check the current locate setting under centos 7 or RHEL 7 ? How to get the list of all available locales in current linux system? In this post you will see that how to set the system locale.
CentOS 7/ RHEL 7 Check Current System Locale Settings
To show the current locale settings, you can view the “/etc/locale.conf” configuration file via “cat /etc/locale.conf” command or issue the following “localectl status” command.
cat / etc / locale.conf
OR
localectl status
Output:
[ root @ devops ~ ] # cat /etc/locale.conf
LANG =es_US.utf8
[ root @ devops ~ ] # localectl status
System Locale: LANG =es_US.utf8
VC Keymap: us
X11 Layout: us
CentOS 7 / RHEL 7 List All Available Locales
Before changing the system locale, you must know that which locales are available on the current system, issue the following command:
localectl list-locales
Example: If you want to select a EN_US locale, then you can list all EN_US locales by issue the following command:
localectl list-locales | grep en_US
Outputs:
[ root @ devops ~ ] # localectl list-locales | grep en_US
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
CentOS 7 / RHEL Change The System Locale
There are two ways to change the system locale by through modifying the “/etc/locale.conf” configuration file or using a new command “localect” which is newly added in centos 7 or RHEL 7 operating system.
Edit “/etc/locale.conf” file using “vim” command and search “LANG” line and change its value as what you want to select the locale. such as: change locale to “en_us.iso88591″.vim /etc/locale.conf
Before:
LANG =es_US.utf8
After:
LANG =en_US.iso88591
Save and exit the above configuration file and reboot the system, then the changes will take effect.
# Set the system locale via localectl command
To set the default system locale, you can use the following command:
localectl set-locale LANG = < locale name >
you need to replace the locale name as you want to select the locale.
Example: changing the default locale to german locale, issue the following command:
localectl set-locale LANG =de_DE.UTF- 8
Outputs:
[ root @ devops ~ ] # localectl set-locale LANG=de_DE.UTF-8
[ root @ devops ~ ] # localectl status
System Locale: LANG =de_DE.UTF- 8
VC Keymap: us
X11 Layout: us
Note:you must log on the system with root user to run localectl command .
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-452803-1-1.html 上篇帖子: Centos安装Kafka集群 下篇帖子: CentOS7 配置接口IP
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表