【问题标题】:Bash commands not found — $PATH damaged [closed]未找到 Bash 命令 - $PATH 损坏 [关闭]
【发布时间】:2013-09-05 00:13:48
【问题描述】:

我更改~/.bash_profile文件时不小心出错了,现在我无法运行任何命令,例如lstouchsudo等。

当我写echo $PATH 时,我得到了这样的结果:

$ echo $PATH
/usr/local/bin:
$

当我输入/bin/cat ~/.bash_profile 时,我得到了这个结果:

export PATH=$HOME/local/node/bin:/usr/local/bin:$PATH
export PATH=/usr/local/bin:$PATHh

但我无法更改它。有人可以帮帮我吗?

【问题讨论】:

  • 你怎么改不了?你可以在终端中使用“vi”或“emacs”吗?
  • 你也可以运行/usr/bin/open -e ~/.bash_profile在TextEdit中编辑~/.bash_profile

标签: macos bash path terminal


【解决方案1】:

如果你能做到/bin/cat,你也应该能做到/usr/bin/vi。或者,只需在本地 shell 中修复它:

PATH=/bin:/usr/bin:/sbin:/usr/sbin

然后运行你最喜欢的编辑器应该会再次工作。

【讨论】:

    猜你喜欢
    • 2015-06-23
    • 2019-03-21
    • 2020-01-16
    • 1970-01-01
    • 2015-07-23
    • 2018-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多