0

In Ubuntu, I can get the default .bashrc by copying from the /etc/skel folder:

cp /etc/skel/.bashrc ~/

This is extremely helpful for me as it gives me all the options and configuration already setup and properly commented.

Is there a similar feature for macOS (currently using macOS Sierra)?

2

On user creation, the home directory contents are copied from a directory /System/Library/User\ Template/<language> (where language is for example English.lproj), so you could copy the original file using:

sudo cp /System/Library/User\ Template/<language>/<file> ~/

The problem is that .bashrc is non-existent in the default profile, so you can just delete it from your home directory to get the initial state.

Though you might check your installation to be 100% sure.

  • Note that there is some standard setup, but it's in /etc/profile and /etc/bashrc rather than in each user's own shell init files. – Gordon Davisson Jan 16 '17 at 4:12
  • I think you should rather post this comment under the question. For me it's clear that OP asks specifically for the files in the home directory, even using an example from Ubuntu. Global rc-files are not specific to macOS, they are used in Ubuntu as well. I have no reason to believe OP asks for the files in /etc. – techraf Jan 16 '17 at 4:18
  • @techraf Thanks for posting your answer techraf! I didn't know about the original files template, that was very helpful. Is there a way to get the content of the initial state for .profile though? I just need to know what configurations are set as default. – Timber Jan 20 '17 at 19:21
  • .profile does not exist by default either. If you have any doubts you can just create a new user account and manually verify its configuration. – techraf Jan 20 '17 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .