Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com May 28 '12 at 16:56

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

    
there is an ubuntu site in SE: askubuntu.com 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 unix.stackexchange.com. –  Dennis Williamson May 28 '12 at 18:18
show 2 more comments

1 Answer 1

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
fi
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
add comment

Your Answer

 
discard

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.