每次遠程登錄都會提示bash: “export: command not found
根據提示肯定是某個設置文件包含了特殊的中文符號,導致系統無法加載
Connecting to xxx.xxx.xxx.xxx:2259...
Connection established.
Escape character is '^@]'. Last login: Fri Mar 1 01:39:34 2019 from 219.135.157.140 -bash: “export: command not found -bash: “export: command not found
查看遠程登錄時候,會自行加載的幾個文件(~/.bash_profile ~/.bashrc /etc/profile)
[root@bigdata ~]# grep export /root/. ./ .bash_history .bash_profile .cshrc .tcshrc ../ .bash_logout .bashrc .ssh/ .viminfo [root@bigdata ~]# grep export /root/.bash .bash_history .bash_logout .bash_profile .bashrc [root@bigdata ~]# grep export /root/.bash_profile export PATH [root@bigdata ~]# grep export /root/.bashrc “export EDITOR=/usr/bin/vim“ “export EDITOR=/usr/bin/vim“ [root@bigdata ~]# cat .bashrc # .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 “export EDITOR=/usr/bin/vim“ “export EDITOR=/usr/bin/vim“
修改文件去掉特殊符號后重新登錄,問題解決
Connecting to xxx.xxx.xxx.xxx:2259... Connection established. Escape character is '^@]'. Last login: Fri Mar 1 02:31:41 2019 from 219.135.157.140 [root@bigdata ~]# [root@bigdata ~]#