Super User is a question and answer site for computer enthusiasts and power users. 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 added a new user in my ubuntu system with

sudo useradd -d /home/peeyush -m peeyush
sudo passwd peeyush

The above list of commands created a new user successfuly but the new user is unable to use the feature of bash completion properly. Using the bashrc file solved the problem.

This problems generally don't occur with traditional create user GUI. What is the reason behind this ?? Do they set the default shell for this user as bash ??

share|improve this question

migrated from May 28 '12 at 16:56

This question came from our site for professional and enthusiast programmers.

there is an ubuntu site in SE: maybe you should ask there instead – santiagozky May 28 '12 at 16:40
the question is not specific to ubuntu – prathmesh.kallurkar May 28 '12 at 16:41
@prathmesh.kallurkar: it's not a programming question, so off-topic on Stack Overflow. (And useradd/default user settings are indeed distro-specific.) – Mat May 28 '12 at 16:43
@Mat "Not a programming question" may be a valid reason to move the question but your point that user settings are distro specific is incorrect reson to close it. I am asking questions about basic command utilities and the mention of a distro Ubuntu in the question is not a valid reason for you to close / vote down a question. I asked the question because I did not know about the thing properly. – prathmesh.kallurkar May 28 '12 at 16:51
There's – Dennis Williamson May 28 '12 at 18:18
up vote 3 down vote accepted

Most probably the new user's default skeleton rc files were not created. You can specify that on creation with the -k SKELETONDIR option to useradd, where SKELETONDIR is usually /etc/skel.

And you should also check what is the default shell for the new user (and change it to /bin/bash if necessary - see man chsh).

If it's bash, add this to his .bashrc:

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
share|improve this answer
thanks for the answer. the skeleton directory was there from the beginning. So, I guess Ubuntu installation uses the same skel folder for new user creation. – prathmesh.kallurkar May 28 '12 at 16:56

You must log in to answer this question.

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