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 am newbie to UNIX. When I was practicing some commands in UNIX. Earlier the Prompt was shown like this "[user@localhost ~]$". After some time it shows "bash-3.2$", but still some commands worked. I tried to change the shell type from bash to ksh and csh. But that didn't worked. How can I change this bash-3.2$ back to [user@localhost ~]$ in bash shell.

share|improve this question

migrated from stackoverflow.com Mar 14 '12 at 11:11

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

1  
or unix.stackexchange.com, even askubuntu.com – madth3 Mar 14 '12 at 2:44
    
Thank you very much. – jibz Mar 14 '12 at 3:44
up vote 0 down vote accepted

take a look at http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html on how to set up the PS1 variable in bash. It has a wide variety of option

share|improve this answer

I noticed I got this same issue when I ran

Akinjides-MacBook-Pro:Desktop akinjide$ $SHELL

The output was 
bash-3.2$ 

so the $SHELL keyword runs the shell specified by the SHELL environment variable.

you can just type exit to leave.

if you run

Akinjides-MacBook-Pro:Desktop akinjide$ sudo -s

The output was 
bash-3.2# 

According to man sudo

-s [command]: The -s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in the password database. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed.

This prompts for your password, and you can just type exit to leave as well.

The main different here is the $ -> Regular user and # -> Super User

share|improve this answer

You must log in to answer this question.

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