现在的位置: 首页 > 综合 > 正文

.bash_profile 和 .bashrc 对比

2013年08月08日 ⁄ 综合 ⁄ 共 531字 ⁄ 字号 评论关闭

一句话,.bash_profile是登陆后的环境变量,.bashrc是未登录的

when working with Linux, Unix, and Mac OS X, I always forget which bash config file to edit when I want to set my PATH and other environmental variables for my shell. Should you edit .bash_profile or .bashrc in your home directory?

You can put configurations in either file, and you can create either if it doesn’t exist. But why two different files? What is the difference?

According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.

ref:http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html

抱歉!评论已关闭.