Dec 2, 2007

console prompt, 終端機提示字串

 if [ "`id -u`" -eq 0 ]; then
      #PS1='# '
        PS1='[\e[0;32m\u @ \w \e[m \A #\!]\n   \# '
    else
      #PS1='$ '
        PS1='[\e[0;32m\u @ \w \e[m \A #\!]\n   \$ '




看起來會像這樣

prompt.png
參考資料:

BASH Shell change the color of my shell prompt under Linux or UNIX

How to: Change / Setup bash custom prompt (PS1)



0 comments:

Post a Comment