原因:
linux本地设置的文件编码格式不是UTF-8
解决办法:
运行locale命令看一下结果:
把LC_CTYPE修改为“zh_CN.UTF-8”:
cd ~/
vi .bashrc
添加:
LANG='POSIX'
LC_CTYPE='zh_CN.UTF-8'
生效:source .bashrc
locale命令查看一下,出现LC_CTYPE=zh_CN.UTF-8即为正常
[root@bhyw1 logs]# cd ~/ [root@bhyw1 ~]#
# .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi LANG='POSIX' LC_CTYPE='zh_CN.UTF-8'