-bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_US.UTF-8): No such file or directory

Linux登录之后报编码问题,编辑配置文件时中文乱码
系统:centos7

Last login: Tue Mar 23 18:02:44 2021 from 10.1.18.96
-bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (zh_US.UTF-8): No such file or directory

解决方式:
localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
上一篇:震惊! 阿里的程序员也不过如此,竟被一个简单的 SQL 查询难住


下一篇:linux中pingpong测试程序的解读