mac终端使用指令一直提示command not found

一般情况下就是因为配了其他软件的PATH, 导致PATH缺少系统指令PATH.

  1. 使用临时环境变量(重启后失效)
    export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    这样就能暂时使用大部分命令了

  2. 进入当前用户home目录 cd ~
    创建 .bash_profile 并编辑
    touch .bash_profile
    open -e .bash_profile
    添加上面的PATH 保存

解决

你可能感兴趣的:(mac终端使用指令一直提示command not found)