1. Perform the command locale view, which appears as follows:
[[Email protected] ~]#localelang=ZH_CN. Gb2312lc_ctype="zh_cn.gb2312"lc_numeric="zh_cn.gb2312"Lc_time="zh_cn.gb2312"lc_collate="zh_cn.gb2312"lc_monetary="zh_cn.gb2312"lc_messages="zh_cn.gb2312"Lc_paper="zh_cn.gb2312"Lc_name="zh_cn.gb2312"lc_address="zh_cn.gb2312"Lc_telephone="zh_cn.gb2312"lc_measurement="zh_cn.gb2312"lc_identification="zh_cn.gb2312"Lc_all=
2. Execute Whereis locale to locate the configuration file, and then modify it
[[Email protected] ~] # whereis localelocale:/usr/bin/locale/usr/lib/locale/etc/locale.conf/usr/share/locale
3. Modify the original value to read as follows:
[[Email protected] ~] # lang="zh_cn.gb18030"
4. Source in force
[[Email protected] ~]#localelang=ZH_CN. Gb2312lc_ctype="zh_cn.gb2312"lc_numeric="zh_cn.gb2312"Lc_time="zh_cn.gb2312"lc_collate="zh_cn.gb2312"lc_monetary="zh_cn.gb2312"lc_messages="zh_cn.gb2312"Lc_paper="zh_cn.gb2312"Lc_name="zh_cn.gb2312"lc_address="zh_cn.gb2312"Lc_telephone="zh_cn.gb2312"lc_measurement="zh_cn.gb2312"lc_identification="zh_cn.gb2312"Lc_all=[[Email protected]~]#source/etc/locale.conf[[Email protected] ~]#localelang=ZH_CN. Gb18030lc_ctype="zh_cn.gb18030"lc_numeric="zh_cn.gb18030"Lc_time="zh_cn.gb18030"lc_collate="zh_cn.gb18030"lc_monetary="zh_cn.gb18030"lc_messages="zh_cn.gb18030"Lc_paper="zh_cn.gb18030"Lc_name="zh_cn.gb18030"lc_address="zh_cn.gb18030"Lc_telephone="zh_cn.gb18030"lc_measurement="zh_cn.gb18030"lc_identification="zh_cn.gb18030"Lc_all=
At this point, even if the switch to another user, execute the command DF is not garbled
[[Email protected] ~]#DFFile system 1k-block used available%mount point/dev/mapper/centos-root 17811456 1033360 16778096 6%/Devtmpfs486708 0 486708 0%/Devtmpfs498976 0 498976 0%/dev/Shmtmpfs498976 7836 491140 2%/Runtmpfs498976 0 498976 0%/sys/fs/Cgroup/DEV/SDA1 1038336 132472 905864 13%/Boottmpfs99796 0 99796 0%/run/user/1000Tmpfs99796 0 99796 0%/run/user/0[[email protected]~]#SU-CATXJDLast login: May 21:37:05 CST 2018PTS/1on [[email protected]~]$ df File System 1K-Block used available%mount point/dev/mapper/centos-root 17811456 1033360 16778096 6%/Devtmpfs486708 0 486708 0%/Devtmpfs498976 0 498976 0%/dev/Shmtmpfs498976 7836 491140 2%/Runtmpfs498976 0 498976 0%/sys/fs/Cgroup/DEV/SDA1 1038336 132472 905864 13%/Boottmpfs99796 0 99796 0%/run/user/1000Tmpfs99796 0 99796 0%/run/user/0
SSH Secure Shell garbled problem