2

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.

10
  • what is your default shell? bash. if so did you add urxvt to $HOME/.bashrc?
    – strings
    Jan 10, 2013 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, 2013 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, 2013 at 7:47
  • No dice, sir. Surely there must be some way to reverse this behavior.
    – user121155
    Jan 10, 2013 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, 2013 at 7:49

1 Answer 1

2

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.

1
  • 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, 2013 at 7:55

You must log in to answer this question.

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