Our thinking


On MacOS, how do you recommend to use .bash_profile and .bashrc? – Quora

I think that .bashrc, is only used for interactive shells (i.e. when you open Terminal) and the other one is for all shell executions (e.g. background processes etc).

I put everything in my .bashrc and then have one line in my .bash_profile that sources .bashrc

All my aliases etc are in .bashrc and my .bash_profile simply contains:

#!/bin/bash
. ~/.bashrc


I’ve had it this way for the past 15 years or so, I can’t remember the exact reasons for setting it up like this – from memory I asked someone far more knowledgeable than me at the time and then it’s been like that ever since, I’ve just migrated my profile from Mac to Mac every time I get a new machine. It works, so I don’t see any reason to change it.

Source: Kai Howells’s answer to On MacOS, how do you recommend to use .bash_profile and .bashrc? – Quora

Leave a Reply

Your email address will not be published. Required fields are marked *