Linux实现彩色提示符

更改用户目录下的.bashrc

加入:

export PS1=‘\[\e[33m\][\u@\h:\W]\$ \[\e[m\]‘ 

例如:

 1 # .bashrc 
 2  
 3 # User specific aliases and functions 
 4  
 5 alias rm=rm -i 
 6 alias cp=cp -i 
 7 alias mv=mv -i 
 8 export PS1=\[\e[33m\][\u@\h:\W]\$ \[\e[m\] 
 9  
10 # Source global definitions 
11 if [ -f /etc/bashrc ]; then 
12         . /etc/bashrc 
13 fi 
14  
15 # less man page colors 
16 export GROFF_NO_SGR=1 
17 export LESS="FRSXQ" 
18 export LESS_TERMCAP_mb=$\E[01;31m 
19 export LESS_TERMCAP_md=$\E[01;31m 
20 export LESS_TERMCAP_me=$\E[0m 
21 export LESS_TERMCAP_so=$\E[01;44;33m 
22 export LESS_TERMCAP_se=$\E[0m 
23 export LESS_TERMCAP_us=$\E[01;32m 
24 export LESS_TERMCAP_ue=$\E[0m 
25  
26 # grep colors 
27 export GREP_OPTIONS=--color=auto 
28 export GREP_COLOR=1;32 
29  
30 export TERMINFO=/usr/share/terminfo 
31 #export TERM=xterm-256color 33  
34 export HISTIGNORE="&:[bf]g:exit" 
35 export HISTCONTROL=ignoredups 
36 export HISTFILESIZE=10000 
37 export HISTSIZE=10000 
38 export HISTTIMEFORMAT="%F %T " 

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。