PS1设置:
liBlack="\[\033[0;30m\]"
boBlack="\[\033[1;30m\]"liRed="\[\033[0;31m\]"boRed="\[\033[1;31m\]"liGreen="\[\033[0;32m\]"boGreen="\[\033[1;32m\]"liYellow="\[\033[0;33m\]"boYellow="\[\033[1;33m\]"liBlue="\[\033[0;34m\]"boBlue="\[\033[1;34m\]"liMagenta="\[\033[0;35m\]"boMagenta="\[\033[1;35m\]"liCyan="\[\033[0;36m\]"boCyan="\[\033[1;36m\]"liWhite="\[\033[0;37m\]"boWhite="\[\033[1;37m\]"#PS1="\n$boGreen\u$liWhite at $boBlue\h$liWhite in $boRed\w $liYellow{\[\`let exitstatus=\$? ; if [[ \${exitstatus} != 0 ]] ; then echo \"\${exitstatus}\" ; else echo "0" ; fi\`\]} \n% $liWhite"PS1="\n$boGreen\u$liWhite at $boBlue\h$liWhite in $boRed\w $liYellow{\[\`let exitstatus=\$? ; if [[ \${exitstatus} != 0 ]] ; then echo \"\${exitstatus}\" ; else echo "0" ; fi\`\]} $boCyan\d $boRed\t \n$boRed------------------->\$ $liYellow"
Mac 配置:
export LS_OPTIONS='--color=auto'
export CLICOLOR='Yes'
export LSCOLORS='ExfxcxdxCxegedabagacad'
"ExfxcxdxCxegedabagacad"的各个字母代表指代的不同颜色:
a blackb redc greend browne bluef magentag cyanh light greyA bold black, usually shows up as dark greyB bold redC bold greenD bold brown, usually shows up as yellowE bold blueF bold magentaG bold cyanH bold light grey; looks like bright whitex default foreground or background
LSCOLOR上方各个字母的次序指代的不同命令:
1. directory2. symbolic link3. socket4. pipe5. executable6. block special 7. character special 8. executable with setuid bit set 9. executable with setgid bit set 10. directory writable to others, with sticky bit 11. directory writable to others, without sticky