當我創建新的終端窗口或關閉終端並重新打開它時,我的.bash_login文件未加載。我要運行:.bash_login文件未在新的終端窗口中加載,或者在關閉終端並重新打開後
源〜/ .bash_login文件
每次爲了讓我的內部.bash_login文件別名工作。任何想法爲什麼?
當我創建新的終端窗口或關閉終端並重新打開它時,我的.bash_login文件未加載。我要運行:.bash_login文件未在新的終端窗口中加載,或者在關閉終端並重新打開後
源〜/ .bash_login文件
每次爲了讓我的內部.bash_login文件別名工作。任何想法爲什麼?
./bash_login
無論何時登錄(重新啓動計算機,重新啓動桌面或連接到遠程計算機等)並創建新的終端都不會登錄。如果您想在每次打開新終端時加載別名,您需要將它們放入/.bashrc
。
你有〜/ .bash_profile文件嗎?如果是這樣,它會優先使用〜/ .bash_login。從bash手冊頁:
When bash is invoked as an interactive login shell, or as a non-
interactive shell with the --login option, it first reads and exe-
cutes commands from the file /etc/profile, if that file exists.
After reading that file, it looks for ~/.bash_profile,
~/.bash_login, and ~/.profile, in that order, and reads and exe-
cutes commands from the first one that exists and is readable.
The --noprofile option may be used when the shell is started to
inhibit this behavior.
/.bashrc或〜/ .bashrc? – skaterdav85
@ skaterdav85:〜/ .bashrc,但這不應該是問題:終端(至少對我來說)打開新的窗口(和標籤)作爲登錄shell。 –
問題是我安裝了oh-my-zsh,所以我沒有意識到bash和zsh是2個獨立的東西。我不得不編輯.zshrc文件並在那裏添加我的別名。我想這相當於.bashrc文件,但對於zsh。現在我需要找出什麼bash和zsh是大聲笑 – skaterdav85