Macos 找不到Bash命令—$路径损坏
我在更改Macos 找不到Bash命令—$路径损坏,macos,bash,path,terminal,Macos,Bash,Path,Terminal,我在更改~/.bash_profile文件时意外出错,现在我无法运行任何命令,例如ls,touch,sudo,等等 当我写入echo$PATH时,我得到以下结果: $ echo $PATH /usr/local/bin: $ export PATH=$HOME/local/node/bin:/usr/local/bin:$PATH export PATH=/usr/local/bin:$PATHh 当我输入/bin/cat~/.bash_profile时,我得到以下结果: $ echo $P
~/.bash_profile
文件时意外出错,现在我无法运行任何命令,例如ls
,touch
,sudo
,等等
当我写入echo$PATH
时,我得到以下结果:
$ echo $PATH
/usr/local/bin:
$
export PATH=$HOME/local/node/bin:/usr/local/bin:$PATH
export PATH=/usr/local/bin:$PATHh
当我输入/bin/cat~/.bash_profile
时,我得到以下结果:
$ echo $PATH
/usr/local/bin:
$
export PATH=$HOME/local/node/bin:/usr/local/bin:$PATH
export PATH=/usr/local/bin:$PATHh
但我无法改变它。有人能帮我吗?如果你能做
/bin/cat
,你也应该能/usr/bin/vi
。或者,只需在本地shell中修复它:
PATH=/bin:/usr/bin:/sbin:/usr/sbin
然后运行您最喜欢的编辑器应该可以再次工作。您怎么无法更改它?您可以在终端中使用“
vi
”或“emacs
”吗?您还可以运行/usr/bin/open-e~/.bash\u profile
在文本编辑中编辑~/.bash\u profile
。可能的重复