Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux「command not found」錯誤三大成因與解決之道

編輯:Linux 教學

初學者頻繁遇到 command not found,主因有三:

  1. 指令拼寫錯誤:如混淆 Windows ipconfig 與 Linux ifconfig / ip a。
  2. 環境變數 PATH 未正確設定:解決兩途 —
    ① 切換 root 執行(root PATH 通常完整);
    ② 為一般用戶補齊 PATH:
    export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
  3. 指令未安裝:透過套件管理器安裝對應套件(如 dnf install net-tools 提供 ifconfig)。

建議養成 which 指令 或 command -v 指令 先驗證指令是否存在的習慣。

Copyright © Windows教程網 All Rights Reserved