美文网首页
MAC终端出现bash:command not found

MAC终端出现bash:command not found

作者: omuraisu | 来源:发表于2017-08-22 23:20 被阅读0次

    今天在配置spark环境的时候改动了etc/profile文件。结果导致打开终端就出现这个错误,只能使用cd命令,其他任何命令都会报错。

    解决办法:

    1.在命令行中输入:export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin 这样可以让命令暂时可以使用。

    2.然后更改profile文件。输入vi etc/profile,改为之前的状态。如果显示为只读文件不能更改,则保存时输入 :w !sudo tee % 便可以保存。

    3.保存完毕后输入source etc/profile 使更改后的profile文件生效。

    完成!

    相关文章

      网友评论

          本文标题:MAC终端出现bash:command not found

          本文链接:https://www.haomeiwen.com/subject/vhurdxtx.html