Results 1 to 7 of 7

Thread: Change Konsole's prompt

  1. #1
    Join Date
    Jan 2016
    Location
    Canada
    Posts
    25

    Default Change Konsole's prompt

    Hi all,

    Probably a frivolous question, but, is there a way to have the '$' as prompt in the Konsole/shell? It currently has '>'. Or is this normal for bash?

    TIA

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,090
    Blog Entries
    15

    Default Re: Change Konsole's prompt

    Quote Originally Posted by Alveric View Post
    Hi all,

    Probably a frivolous question, but, is there a way to have the '$' as prompt in the Konsole/shell? It currently has '>'. Or is this normal for bash?

    TIA
    Hi
    Set the PS1 environment variable;
    Code:
    export PS1="\[\e[32;1m\]\u@\h:\w$\[\e[0m\] "
    If it's what you want, then add to your ~/.bashrc file (note you don't need the export bit).

    See more at;
    http://www.thegeekstuff.com/2008/09/...ngelina-jolie/
    http://misc.flogisoft.com/bash/tip_c...and_formatting

    You can even add emoticons these days as well....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,004
    Blog Entries
    2

    Default Re: Change Konsole's prompt

    Currently by default,
    The two command prompts you describe happen to denote whether you are logged in as root or as a normal User.

    Recommend you don't modify those...

    You can test for yourself... open a normal user console and your prompt will be ">"
    "su" to root, and watch the prompt change to "$"

    TSU

  4. #4
    Join Date
    Jun 2010
    Location
    Spain
    Posts
    110

    Default Re: Change Konsole's prompt

    and for dummies like me: http://bashrcgenerator.com/
    It's really easy!!
    Registered GNU/Linux user:#528067 - openSUSE Tumbleweed + KDE

    "we are all atheists about most of the gods that humanity has ever believed in. Some of us just go one god further."
    Richard Dawkins

  5. #5
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,985

    Default Re: Change Konsole's prompt

    Quote Originally Posted by tsu2 View Post
    "su" to root, and watch the prompt change to "$"
    Here on oS 13.2 and earlier it's always been "#". Did it change in Leap?

  6. #6
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,985

    Default Re: Change Konsole's prompt

    Just for sake of completeness, I've seen many examples in books and internet tutorials where the user prompt is "$", as the OP likes.

  7. #7
    Join Date
    Jan 2016
    Location
    Canada
    Posts
    25

    Default Re: Change Konsole's prompt

    Quote Originally Posted by brunomcl View Post
    Just for sake of completeness, I've seen many examples in books and internet tutorials where the user prompt is "$", as the OP likes.
    This.

    Learning Linux with a book right now and their prompt for normal users is always $, and I wanted consistency. I can get the $ prompt if I use the sh shell, but I'd rather just bash. It's just that the '>' looks too Windowsy for me.

    Thanks for all the replies, and sorry for not replying earlier myself, but when I saw the first replies and visited the linked pages I was blown away by all that code, variables and whatnot. Now I can understand things a wee bit better. Thanks again.

Posting Permissions

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