Linux Set Locale
2021-03-20 本文已影响0人
hynial
Current locale
$ locale
All Available locale
locale -a
Details of a Specific Variable
locale -c -k LC_TIME
Change locale
vim ~/.bashrc
LANG="zh_CN.utf8"
LC_ALL="zh_CN.utf8"
export LANG
export LC_ALL
source ~/.bashrc
You can find global locale settings in the following files:
- /etc/default/locale – on Ubuntu/Debian
- /etc/locale.conf – on CentOS/RHEL
The following command sets LANG to en_IN.UTF-8 and removes definitions for LANGUAGE.
$ sudo update-locale LANG=LANG=en_IN.UTF-8 LANGUAGE
OR
$ sudo localectl set-locale LANG=en_IN.UTF-8
To configure a specific locale parameter, edit the appropriate variable. For instance.
$ sudo update-locale LC_TIME=en_IN.UTF-8
OR
$ sudo localectl set-locale LC_TIME=en_IN.UTF-8
Ubuntu
sudo apt-get install locales
sudo locale-gen zh_CN.UTF-8
sudo localedef -c -f UTF-8 -i zh_CN zh_CN.utf8