阅读《Beyond Linux From Scratch》一书中的dircolors.sh小节:
该脚本使用
~/.dircolors和/etc/dircolorsfiles 来控制目录列表中文件名的颜色。它们控制诸如ls --color之类的彩色输出。如何初始化这些文件的说明位于本节末尾。Run Code Online (Sandbox Code Playgroud)cat > /etc/profile.d/dircolors.sh << "EOF" # Setup for /bin/ls and /bin/grep to support color, the alias is in /etc/bashrc. if [ -f "/etc/dircolors" ] ; then eval $(dircolors -b /etc/dircolors) if [ -f "$HOME/.dircolors" ] ; then eval $(dircolors -b $HOME/.dircolors) fi fi alias ls='ls --color=auto' alias grep='grep --color=auto' EOF
| 归档时间: |
|
| 查看次数: |
19789 次 |
| 最近记录: |