debian去除目录默认蓝色的方法 - tuhaiyang/soft GitHub Wiki
生成DIR_COLORS文件:
dircolors -p >DIR_COLORS
复制文件到系统用户根目录下:
cp DIR_COLORS ~/.dir_colors
1、这个背景颜色是目录在其他用户可写的情况下默认添加的,可以修改,35就是把目录修改成粉色了,01应该就是设置成粗体:
echo "OTHER_WRITABLE 01;35" >> $HOME/.dir_colors
2、然后在.bashrc里添加(这个.bashrc可以通过“find / -name .bashrc”命令查找,我的是修改的/home/.bashrc):
eval "dircolors $HOME/.dir_colors"
如下是.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\$ '
#umask 022
#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'
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
eval dircolors $HOME/.dir_colors
#Some more alias to avoid making mistakes:
#alias rm='rm -i'
#alias cp='cp -i'
#alias mv='mv -i'
alias ls='ls --color'
export LANG=C.UTF-8
3、最后执行以下命令,使修改生效:
source ~/.bashrc