2

在我将 PATH 的服务器 ~bash_profile 更改为我的 Java 之后,我不能再使用 nano 或 vip 了。

我实际上不知道如何改回来,而我不能再用 nano 或 vi 编辑它了。

我能做些什么?

 -bash: ano: command not found
 root@s [~]# nano
 -bash: nano: command not found
 root@s [~]# pacstrap -i /mnt base base-devel
 -bash: pacstrap: command not found
 root@s [~]# nano /etc/timezon
 -bash: nano: command not found
 root@s [~]# nano /etc/timezone
 -bash: nano: command not found
 root@s [~]# vi
 -bash: vi: command not found
 root@s [~]# vi
 -bash: vi: command not found
 root@s [~]# nano ~/.bash_profile
 -bash: nano: command not found
 root@s [~]# vi ~/.bash_profile
 -bash: vi: command not found
 root@s [~]# 
4

1 回答 1

5

您很可能只是覆盖了 java 的路径,而不是附加到它。

错误

export PATH=/opt/somewhere/java/bin

export PATH=$PATH:/opt/somewhere/java/bin

要解决此问题,请执行

export PATH=/bin:/usr/bin:/usr/local/bin

...你应该有 vi 和 nano 回到你的路径。

于 2013-01-22T11:27:30.500 回答