美文网首页
.[bash_]profile and .bashrc区别

.[bash_]profile and .bashrc区别

作者: 谢昆明 | 来源:发表于2017-03-08 16:59 被阅读12次

    .[bash_]profile and .bashrc can be used on both OS X and Linux. The former is loaded when the shell is a login shell; the latter when it is not. The real difference is that Linux runs a login shell when the user logs into a graphical session, and then, when you open a terminal application, those shells are non-login shells; whereas OS X does not run a shell upon graphical login, and when you run a shell from Terminal.app, that is a login shell.

    If you want your aliases to work in both login and non-login shells (and you usually do), you should put them in .bashrc and source .bashrc in your .bash_profile, with a line like this:
    [ -r ~/.bashrc ] && source ~/.bashrc
    This applies to any system using bash.

    打赏

    如果这篇文章解决了您的问题,让我买根烟抽抽。

    支付宝.jpg 微信.jpg

    相关文章

      网友评论

          本文标题:.[bash_]profile and .bashrc区别

          本文链接:https://www.haomeiwen.com/subject/czobgttx.html