Answers:
在OSX中,.bash_profile使用代替.bashrc。
是的,该.bash_profile文件应位于/Users/YourName/
(换句话说,~/.bash_profile)
例如, /Users/Aaron/.bash_profile
source ~/.bashrc
.[bash_]profile并且.bashrc可以在OS X和Linux的使用。前者在外壳为登录外壳时加载;后者则不是。真正的区别在于,Linux在用户登录图形会话时运行登录外壳,然后在您打开终端应用程序时,这些外壳是非登录外壳。而OS X不会在图形登录时运行shell,而当您从Terminal.app运行shell时,这就是登录shell。
如果您希望别名在登录外壳程序和非登录外壳程序中都可以使用(并且通常这样做),则应将它们放在.bashrc中,并将.bashrc 源放在您的.bash_profile中,并带有如下一行:
[ -r ~/.bashrc ] && source ~/.bashrc
这适用于任何使用bash的系统。
.profile为即可.bashrc。
.profile_...?