/dev/null | grep "^\*" | sed -e "s/^\*\ //"`" if [ "${branch}" != "" ];then if ..._ubuntu server配置bash显示">
赞
踩
1、更改用户和git显示
- function git_branch {
- branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
- if [ "${branch}" != "" ];then
- if [ "${branch}" = "(no branch)" ];then
- branch="(`git rev-parse --short HEAD`...)"
- fi
- echo " [*$branch]"
- fi
- }
-
- export PS1='\[\033[01;32m\]\@ \[\033[01;36m\]\W\[\033[01;32m\]$(git_branch)\[\033[00m\] '
dircolors -p # 查看系统当前的文件名称显示的颜色配置
- cd ~
- dircolors -p > .dircolors # 将配置重定向到.dircolors文件中
- vim ~/.dircolors # 修改.dirclors中的值
- source ~/.bashrc
变量名 | 含义 |
---|---|
NORMAL | global default, although everything should be something |
FILE | normal file |
DIR | directory |
LINK | symbolic link |
FIFO | pipe |
SOCK | socket |
BLK | block device driver |
CHR | character device driver |
ORPHAN | orphaned syminks |
MISSING | ... and the files they point to |
EXEC | This is for files with execute permission |
编码 | 效果 |
---|---|
00 | normal (no color、no bold) |
01 | Bold // 粗体 |
编码 | 效果 |
---|---|
30 | Black //黑色 |
31 | Red //红色 |
32 | Green //绿色 |
33 | Yellow //黄色 |
34 | Blue //蓝色 |
35 | Magenta //洋红色 |
36 | Cyan //蓝绿色 |
37 | White //白色 |
编码 | 效果 |
---|---|
40 | Black //黑色 |
41 | Red //红色 |
42 | Green //绿色 |
43 | Yellow //黄色 |
44 | Blue //蓝色 |
45 | Magenta //洋红色 |
46 | Cyan //蓝绿色 |
47 | White //白色 |
以上为个人喜好配置,可做调整!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。