2012-09-26 70 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. 
相关问题