【1】查看当前系统语言
登陆linux系统打开操作终端之后,输入 echo $LANG可以查看当前使用的系统语言。
[root@localhost ~]# echo $LANG
查看安装的语言包
查看是否有中文语言包可以在终端输入 locale命令,如有zh cn 表示已经安装了中文语言
[root@localhost ~]# locale LANG=zh_CN.UTF-8 LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL=
【2】修改系统语言为中文
修改.bash_profile文件,文件末尾加上export LANG=zh_CN.UTF-8
[root@liujunpcV7-05 ~]# cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export JAVA_HOME=/usr/jdk1.8.0_202 export CLASSPATH=$JAVA_HOME/lib/ export PATH=$PATH:$JAVA_HOME/bin export PATH JAVA_HOME CLASSPATH export LANG=zh_CN.UTF-8
【3】执行参数文件:
[root@xxxxpcV7-05 ~]# . ./.bash_profile
标签:zh,CN,centos,UTF,乱码,export,PATH,postgresql,LC From: https://www.cnblogs.com/qsds/p/16841872.html