|
发表于 2006-4-20 00:41:42
|
显示全部楼层
一般存在于 ~/.bashrc
这里放几个我常用的PS1
- PS1='\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w\[\033[1;36m\]\$ \[\033[0m\]'
复制代码
这个比较花哨点
- # Color Variables for Prompt
- GRAD1='\333\262\261\260'
- GRAD2='\260\261\262\333'
- YLOBRN='\[\033[01;33;43m\]'
- WHTBRN='\[\033[01;37;43m\]'
- REDBRN='\[\033[00;31;43m\]'
- REDBLK='\[\033[00;31;40m\]'
- PPLBLK='\[\033[01;35;40m\]'
- WHTBLK='\[\033[01;37;40m\]'
- NONE='\[\033[00m\]'
- HBLK='\[\033[00;30;30m\]'
- HBLU='\[\033[01;34;34m\]'
- BLU='\[\033[00;34;34m\]'
- YEL='\[\033[00;33;33m\]'
- WHT='\[\033[01;37;37m\]'
- PRPL='\[\033[00;34;35m\]'
- RED='\[\033[01;31;31m\]'
- NORM='\[\033[01;00;0m\]'
- export GRAD1 GRAD2 YLOBRN WHTBRN REDBRN REDBLK PPLBLK WHTBLK NONE HBLK HBLU BLUYEL WHT PRPL RED NORM
- # Prompt Settings
- if [ `/usr/bin/whoami` = 'root' ]
- then
- if [ "$SHELL" = '/bin/bash' ] || [ "$SHELL" = '/bin/sh' ]
- then
- PS1='\n'$RED'\,,,/ ['$WHT'\w'$RED'] \n'$RED'('$WHT'O'$RED'_'$WHT'O'$RED') ['$WHT'\u'$RED'@'$WHT'\h'$RED']\n '$RED'('$WHT'O'$RED') ['$WHT'\d'$RED'] '$WHT'| '$RED'['$WHT'\t'$RED']\n '$WHT'# '
- PS2=' '$RED'# '
- fi
- else
- if [ "$SHELL" = '/bin/bash' ] || [ "$SHELL" = '/bin/sh' ]
- then
- PS1='\n'$BLU'\,,,/ ['$WHT'\w'$BLU'] \n'$BLU'('$WHT'o'$BLU'_'$WHT'o'$BLU') ['$WHT'\u'$HBLU'@'$WHT'\h'$BLU']\n '$BLU'('$WHT'-'$BLU') ['$WHT'\d'$BLU'] '$WHT'|'$BLU'['$WHT'\t'$BLU']\n '$WHT'# '
- PS2=' '$WHT'# '
- fi
- fi
复制代码 |
|