在Centos6.8上安装一个软件包时,需要在/etc/profile中添加两行内容,添加错了,
添加完之后保存执行:source /etc/profile,然后执行ls,发现报-bash: ls: command not found 的错误
,执行vi filename命令,报 -bash: vi: 没有那个文件或目录 的错误。
此时需要用vi的绝对路径将修改过的文件恢复原状, /bin/vi /etc/profile
或者是 用类似WinSCP的工具打开/etc/profile文件,恢复原状保存后,执行
source /etc/profile