使用SSH secure远程连接linux时,查看linux里的内容,

发现乱码。这是由于SSH secure客户端的编码是gbk ,而

linux的默认编码是utf-8

centos7 将编码集改成GBK

要解决乱码问题,必须将linux的编码改为GBK。

 

我们进入  /etc/sysconfig 中发现并没有 i18n 文件

centos7 将编码集改成GBK

经查阅资料后得知,centOS7有关字符编码的文件移动到 /etc/locale.conf  

进入etc后 查看locale.conf   : cat locale.conf  

centos7 将编码集改成GBK

修改cat locale.conf  的内容:

  执行命令:localectl set-locale  LANG=zh_CN.gbk  

  此时要刷新bash 或者重启,使设置生效

 

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2022-01-11
猜你喜欢
  • 2022-02-07
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
相关资源
相似解决方案