MacOS下出現-bash: 命令: command not found的解決方法


MacOS下出現-bash: 命令: command not found的解決方法

1.在命令行輸入:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

2.進入當前用戶的home目錄:

cd ~/

3.創建bash_profile執行命令:

touch .bash_profile

4.打開並編輯bash_profile 執行命令:

open .bash_profile

5. 在打開的記事本中會顯示之前配置過的path, 進行保存 全選: command+s 或者不放心的話 選中記事本 文件-保存 保存之后沒提示 直接關掉就可以。

6. 此時在命令行中輸入更新命令(命令行一直不要關):

source .bash_profile

到此就結束 重啟終端命令就可以了,親測有效!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM