美文网首页
mac上终端出现 command not found解决方法

mac上终端出现 command not found解决方法

作者: 90后的晨仔 | 来源:发表于2018-03-18 16:34 被阅读4990次
    今天在装Java JDK的时候突然出现一些命令command not found的命令,之前配置java path的时候可能修改了profile导致的。
    只有ls cd等命令可以用, vim, sudo, man等提示command not found。
    

    1.首先输入命令,让暂时可以使用vim等命令
    2.然后打开~/.bash_profile
    export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
    3.然后打开~/.bash_profile
    vim ~/.bash_profile
    4.加入path
    export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:${JAVA_HOME}:${JAVA_HOME}/bin"
    5.重启profile
    source ~/.bash_profile
    6.退出terminal, 重新打开,输入vim查看是否有效

    相关文章

      网友评论

          本文标题:mac上终端出现 command not found解决方法

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