Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've been messing with the chsh command so that I could change the name displayed in my shell before each command is issued, for example picard@ubuntu:$. My problem arose when I gave the command chsh -s /bin/ksh picard, not fully knowing what the results would be. Among this command, I also used grep ksh /etc/shells/. Now, any time I try to open a terminal, be it bash, dash, sh or urxvt, it either just doesn't open or starts spawning instances of urxvt until it has so many open, the computer hangs and then the instances are all closed.

What exactly did I screw up? I really would prefer not having to reinstall, but I can't use Linux without a command line, which I'm sure you guys can sympathize with.

share|improve this question
    
what is your default shell? bash. if so did you add urxvt to $HOME/.bashrc? –  strings Jan 10 '13 at 7:44
    
My default shell is(was) urxvt. Now, I can't even get a shell open. I will try what you suggested and report back. –  user121155 Jan 10 '13 at 7:46
    
That is the problem. urxvt is recursively calling its self over and over again. use ctrl+alt+F2 and log in as root and change your default shell. –  strings Jan 10 '13 at 7:47
    
No dice, sir. Surely there must be some way to reverse this behavior. –  user121155 Jan 10 '13 at 7:48
    
I used chsh -s to change the shell, however I didn't know what to put after the command so it was mostly guesswork. After I rebooted, this situation happened. How do I change my default shell? –  user121155 Jan 10 '13 at 7:49
show 5 more comments

1 Answer

up vote 2 down vote accepted

The command chsh has nothing to do with changing your prompt. As the manpage of chsh(1) writes, it's purpose is to change your login shell. So at the moment ksh is your login shell. If you want to change that, simply enter

chsh -s /bin/bash picard

This makes bash your login shell. Usually this is the default at Ubuntu.

You can also open a terminal with the command urxvt -e /bin/bash or just urxvt -e bash. When you open a terminal without using the -e option, your system will start ksh. By default ksh only uses $ as prompt. So thatswhy you see no fancy user@system prompt.

However another way to change back your login shell is to edit /etc/passwd. Open the file with your favorite editor like:

sudo vim /etc/passwd #or
sudo nano /etc/passwd #or
gksudo gedit /etc/passwd

and move to the line with your user name. At the end of the line you'll find /bin/ksh. Change it to /bin/bash, save the file and log in again. Now you should have your usual shell back.

If you want to change your prompt, enter echo $PS1 to see actual settings. The bash manpage tells you what to change to have a nice prompt.

share|improve this answer
    
Thanks for the info. Do you have any idea why the terminal wouldn't be accepting my root login? It says the password is invalid, which I know is not true. –  user121155 Jan 10 '13 at 7:55
    
Nevermind, it's working now. Thank you! –  user121155 Jan 10 '13 at 8:21
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.