.bash_profile, .bashrc, .profile, which is which?

I use SSH to login my iMac. And I use SCREEN command all the time. Those configuration files are really confusing.

  1. ~/.bash_profile. It will be loaded when you use SSH to login.
  2. ~/.bashrc. It will be loaded when you use SCREEN to enter a new bash.
  3. ~/.profile. If ~/.bash_profile doesn’t exist, the system will look for .profile file.

So, only .bash_profile and .bashrc are crucial for me. I usually do not edit them. I have a file to store my personal command like alias sl=’screen -ls’. And I add source ~/personal_cmd.sh at the end of .bash_profile and .bashrc to use them anytime and anywhere.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s