
實際上,我在安裝一些軟體時搞砸了$PATH
變數。~/.bash_profile
而不是使用
export PATH=$PATH:/some/other/path
我愚蠢地這樣做了
export PATH=~/some/other/path
所以,不,我不能使用任何命令。如果我嘗試ls
,我會得到這個;
$ ls
bash: ls: command not found...
Similar command is: 'lz'
我該如何編輯我的內容~/.bash_profile
來解決這個混亂?我無法使用 vim 或 emacs。
答案1
/bin/nano ~/.bashrc
或者
/usr/bin/emacs ~/.bashrc
或者
/usr/bin/vim ~/.bashrc
答案2
只需使用 emacs 或 vim 的完整路徑即可。 IE。
/bin/vim .bash_profile
答案3
答案4
如果您不想使用vim
,emacs
或者nano
只需使用您最喜歡的編輯器並編輯bash_profile
位於您的主目錄中的檔案。
atom ~/.bash_profile
或者
subl ~/.bash_profile
然後在底部編輯你想要的任何內容。