https://access.redhat.com/solutions/3533681
How to set LC_ALL for systemwide changes?
SOLUTION UNVERIFIED - 已更新 2018年七月19日02:20 -
环境
- Red Hat Enterprise Linux 7
问题
-
How to set
LC_ALLin Red Hat Enterprise Linux 7? -
How to set
LC_ALLto persist after system reboot?
决议
- Append
LC_ALLand the required locale to/etc/environmentfile and log out for the changes to take effect.
For Example:
[root@example ~]# locale
LANG=en_AU.UTF-8
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"
LC_ALL=
[root@example ~]# cat /etc/locale.conf
LANG="en_AU.UTF-8"
- To set
LC_ALL=en_US.UTF-8append this entry in/etc/environment
[root@example ~]# cat /etc/environment
LC_ALL=en_US.UTF-8
Logout and then log in for the effect to take place
[root@example ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
- This changes can also be performed in
/etc/locale.confhowever, the Lang parameter will not change and if the output of#localecommand is checked, it will show the original value. To avoid confusion, it is better to modify/etc/environment

本文介绍如何在Red Hat Enterprise Linux 7中永久设置LC_ALL环境变量,以实现系统范围内的语言和区域设置更改。通过修改/etc/environment文件,可以在系统重启后保持这些设置不变。
1579

被折叠的 条评论
为什么被折叠?



