2012-09-26 71 views

回答

1

./bash_login無論何時登錄(重新啓動計算機,重新啓動桌面或連接到遠程計算機等)並創建新的終端都不會登錄。如果您想在每次打開新終端時加載別名,您需要將它們放入/.bashrc

+0

/.bashrc或〜/ .bashrc? – skaterdav85

+0

@ skaterdav85:〜/ .bashrc,但這不應該是問題:終端(至少對我來說)打開新的窗口(和標籤)作爲登錄shell。 –

+0

問題是我安裝了oh-my-zsh,所以我沒有意識到bash和zsh是2個獨立的東西。我不得不編輯.zshrc文件並在那裏添加我的別名。我想這相當於.bashrc文件,但對於zsh。現在我需要找出什麼bash和zsh是大聲笑 – skaterdav85

1

你有〜/ .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. 
相關問題