Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I want to automatically create a directory called ".virtualenvs" in each new user's home directory upon creation of that new user.

I am using the useradd command to create new users.

share|improve this question
up vote 9 down vote accepted

Create the directory /etc/skel/.virtualenvs. The /etc/skel directory will be used as a skeleton for a new home directory.

It's defined in /etc/adduser.conf:

# The SKEL variable specifies the directory containing "skeletal" user
# files; in other words, files such as a sample .profile that will be
# copied to the new user's home directory when it is created.
share|improve this answer
If you're giving your users virtualenvwrapper you can add the $WORKON_HOME environment variable to /etc/skel/.bashrc as well – Stephen Paulger Mar 28 '11 at 22:29

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.