zhao-sun.com

April 9, 2004

Change Prompt in bash or tcsh

Filed under: Computer — blogadmin @ 10:49 pm


  • for bashrc

    # .bashrc

    # very basic

    #export PS1=”\w: ”



    # basic with time

    export PS1=”[\@ \u] \w: ”



    # blue background

    #export PS1=”\[33[44m\](\@) \w: \[33[44m\]”



    # basic yellow

    #export PS1=’\[33[0;33m\](\n\@) \w :33[0m\]’



    # yellow

    #export PS1=”[33[0;33m\]\u@\h \w]\\$ ”



    # WHITE=”\[33[1;37m\]”

    #export PS1=”[33[1;37m\]\u@\h \w]\\$ ”



    #Black=

    #export PS1=”[33[0;30m\]\u@\h \w]\\$ ”



    #Blue

    #export PS1=”[33[0;34m\]\u@\h \w]\\$ ”



    #Green

    #export PS1=”[33[0;32m\]\u@\h \w]\\$ ”



    #Cyan

    #export PS1=”[33[0;36m\]\u@\h \w]\\$ ”



    #Red

    #export PS1=”[33[0;31m\]\u@\h \w]\\$ ”



    #Purple

    #export PS1=”[33[0;35m\]\u@\h \w]\\$ ”



    #Brown

    #export PS1=”[33[0;33m\]\u@\h \w]\\$ ”




    #Gray

    #export PS1=”[33[0;37m\]\u@\h \w]\\$ ”



    #DarkGray

    #export PS1=”[33[1;30m\]\u@\h \w]\\$ ”



    #LightBlue

    #export PS1=”[33[1;34m\]\u@\h \w]\\$ ”



    #LightGreen

    #export PS1=”[33[1;32m\]\u@\h \w]\\$ ”



    #LightCyan

    #export PS1=”[33[1;36m\]\u@\h \w]\\$ ”



    #LightRed

    #export PS1=”[33[1;31m\]\u@\h \w]\\$ ”



    #Yellow

    #export PS1=”[33[0;33m\]\u@\h \w]\\$ ”



    #White

    #export PS1=”[33[1;37m\]\u@\h \w]\\$ ”

  • For cshrc on unix, using

    set prompt=\[`/usr/xpg4/bin/id -nu`@`hostname`’ %~’\]\$’ ‘

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress