3

I've used unix/linux at work in the past, and recently started developing on a Mac. I'd always (lovingly) borrow co-workers' bashrc's for a good starting point, such as common aliasing and commands, but I'm a bit at a loss when it comes from building my own from scratch.

Is there a resource that has good "boilerplate" bashrc files (or other shell config files, for that matter) that will have most if not all of what I want -- even stuff I don't know I need yet? ;)

  • 1
    a lot of examples are at github, take look at the dotfiles. – user55518 Mar 26 '14 at 17:04
  • 2
    I see, but bash is not markup and there is no such thing like boilerplate. rather public bashrc files and they are always different and depend on what you have installed. I also write this as comment, because it's possible someone has a good resource for you. – user55518 Mar 26 '14 at 17:20
  • 1
    @bersch "boilerplate" does not necessarily, or even usually, refer to "markup" and the OP's terminology here is completely normative: en.wikipedia.org/wiki/Boilerplate_code E.g., the skeleton stuff your system uses to create a default .bashrc is boilerplate. – goldilocks Mar 26 '14 at 17:32
  • 1
    I keep all of my custom "dot files" in git and the first time I log into a new home directory I do a git init, and a git pull and then I have all my settings that I'm used to. I have branches for different OSes and shells. – functionvoid Mar 26 '14 at 18:01
  • 2
    @bersh Q.v. /etc/skel/.bashrc == bashrc-boilerplate. The system copies this into new home directories. – goldilocks Mar 26 '14 at 18:13
4

The Arch Wiki has some example aliases and generic commands that will work in the majority of .bashrc files providing you are using systemd and have sudo installed.

This highlights the problem with the approach you are seeking, and one of the undesirable side effects of copying and pasting someone else's idea of a standard configuration into your shell 's config. You run two risks: introducing material that is not suitable for your environment or, much worse, adding configuration options that are just plain wrong but that the person before you had added because they were similarly misinformed. As an example, look through some .bashrc files in git/hg repositories and note how many export a TERM...

You are much better off starting with whatever your distro ships and then adding options that are familiar and tested by you, documented in the man page or—if you do want to use options in other people's configs—add them one at a time and make sure they do what they are supposed to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.