修改 文件和文件夹的颜色主要是要修改root目录下的.bashrc文件的内容!
没有修改前.bashrc文件内容为如下:
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}h:w$ '
# You may uncomment the following lines if you want `ls' to be colorized:
#export LS_OPTIONS='--color=auto'
#eval "`dircolors`"
#alias ls='ls $LS_OPTIONS'
#alias ll='ls $LS_OPTIONS -l'
#alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
#alias rm='rm -i'
#alias cp='cp -i'
# alias mv='mv -i'
颜色的修改主要有PS1决定,PS1变量代表的内容就是用户名+主机名+路径名(长路径)+ $。
首先我们要知道如下几张表:
前景 背景 颜色
---------------------------------------
30 40 黑色
31 41 紅色
32 42 綠色
33 43 黃色
34 44 藍色
35 45 紫紅色
36 46 青藍色
37 47 白色
1 透明色
代码 意义
-------------------------
0 OFF
1 高亮显示
4 underline
5 闪烁
7 反白显示
8 不可见
序列说明
a ASCII响铃字符(也可以键入