Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Ubuntu 10.4 I have edited the /etc/bash.bashrc file to set some variables like the command history size (HISTSIZE=5000), however if I create a new users Ubuntu by default gives them a .bashrc file in their home directory with this set as HISTSIZE=1000 which is overriding mine. How can I change the default .bashrc file that is created?

share|improve this question
up vote 19 down vote accepted

You may put default configurations in /etc/skel so that useradd(8) can copy files in /etc/skel whenever it creates new user's directory by '-m' option.

Note that this is used only for the new-user. Existing user accounts are not affected.

share|improve this answer
thanks - very helpful – cwd Dec 12 '11 at 4:09
If you want to set this up proactively, tell the .bashrc file in /etc/skel/ to source, for instance, /etc/defaults/bashrc or whatever file you choose. That still won't prevent users from removing the line in their own .bashrc if they want it gone, but. – Shadur Dec 12 '11 at 7:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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