How to share .bashrc files between two mac user accounts

You can use the ln tool to create a symbolic link:

ln -s /Users/user1/.bashrc /Users/user2/.bashrc

In this example you are creating a new link for user2 pointing back to the existing file in user1's directory. You may need to use sudo ln ... if the permissions are not set correctly.


There are many ways to accomplish this, but the common idiom I've seen is to install a single file outside each user's home folder and have both ~/.bashrc files source in the common file.

This allows clarity, potential to make user-level changes at a later date, but also only maintain one file that will survive whether or not one or both users are deleted at a later date.

It's a little more work than hard linking the file and my experience in using soft links for this sort of thing is to avoid them since some tools don't handle soft (or sym) links as well as you might hope.

It's also far easier than using code control to deploy files, but that's also a great way to manage change if you are going to be setting up git or mercurial or another version control system anyhow.