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