載入終端機時出錯

載入終端機時出錯

每次我運行一個新的終端機視窗(在我做任何事情之前),我都會收到以下訊息:

env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
-bash: grep: command not found
-bash: tar: command not found
-bash: cat: command not found

例如,當我輸入 時cd ~/,我得到:-bash: find: command not found

有人可以幫忙嗎?我不知道從哪裡開始。先致謝!

答案1

看起來您的 $PATH 環境變數已被修改或已重設。您必須找出它的設定(或附加)位置。當您登入時,系統會執行 /etc/profile,然後執行 ~/.bash_profile (取決於您的 shell)。確保 $PATH 設定正確,然後確保 grep/tar/cat 實際上在您的路徑中。

答案2

您的個人資料似乎有問題 ( ~/.profile)。檢查~/.bashrc 和的內容/etc/profile

這些文件似乎有問題;看起來 PATH 丟失或格式錯誤。

PATH 應包含/usr/bin/bin,通常設定在/etc/profile.

相關內容