Find the answer to your Linux question:
Results 1 to 7 of 7
my terminal went from [markus@localhost/server]$ to bash-2.04$. how do i change it back? i've searched some forums but what i found went over my head. i don't yet know how ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2005
    Posts
    20

    terminal prompt changed!


    my terminal went from [markus@localhost/server]$ to bash-2.04$. how do i change it back? i've searched some forums but what i found went over my head. i don't yet know how to write code in files. i'm obviously new to linux so please, as simple as possible. thanks for any insight.

  2. #2
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    In your /home/username/.bashrc (note the . before bashrc) file put
    Code:
    PS1='\u@\h \w \$ '
    if you want it without colour, and
    Code:
    PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w \$ \[\033[00m\]
    if you want it with colour.

    Save the changes, and then to see them either open up a new terminal, or type
    Code:
    source ~/.bashrc
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  3. #3
    Just Joined!
    Join Date
    Nov 2005
    Posts
    20
    i don't have that file. now what do i do?

  4. #4
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    just create it. As a user do
    Code:
    nano ~/.bashrc
    (replacing nano with your favourite text editor), and you'll be fine.
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  5. #5
    Just Joined!
    Join Date
    Nov 2005
    Posts
    20
    im sorry but i don't know what that means. i am a complete newbie. do i open a text editor and write that? or type that in cli. whats up w/ that tilde. ppl i greatly appreciate the help, but remember im stupid

  6. #6
    Linux Guru AlexK's Avatar
    Join Date
    Feb 2005
    Location
    Earth
    Posts
    3,379
    You would most likely have the file already there, the . (dot) infront of the name means that it is hidden. Simply select view hidden files from your file manager and edit it using your favourite editor.

    the ~/ is short form for your home directory. Yes and you just type that into the cli. Nano is just a cli based text editor, although there is nothing stopping you from using kate, gedit etc....

    Theres a small typo that dylunio made in the colour coded part in his 1st post, it should actually be:
    Code:
    PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w \$ \[\033[00m\]'
    just added the ending ' character.

    dylunio, I know what the \u and \h stuff mean, but what are all the other parts, i know they somehow bring out the colour, but how does it accomplish this?
    Life is complex, it has a real part and an imaginary part.

  7. #7
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    dylunio, I know what the \u and \h stuff mean, but what are all the other parts, i know they somehow bring out the colour, but how does it accomplish this?
    To be honest I'm not 100% sure. I know that each code represents a colour.

    With \033[01;32m\ I think the \033 tells it to use colour, and then in the brackets the 01 states if it is bold, and the 32m states which coulour it is. With the last in the line [\033[00m\] that unsets all th colours so that you have plane old black and white when typing.
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •