NAME[名字]
dircolors - 设置‘ls'显示结果的颜色
SYNOPSIS[总览]
dircolors [-b] [--sh] [--bourne-shell] [-c] [--csh] [--c-shell] [-p] [--print-database] [--help] [--version] [FILE]
描述
dircolors 输出希望得到的输出颜色,是由 ls (和 dir, 等.). 典型的用法:
- eval `dircolors [OPTION]... [FILE]`
如果指定了 FILE , dircolors 从该文件确定那些颜色用于什么文件类型和外延. 否则使用一个预先编译好的数据库. 关于这个文件的详细格式, 运行`dircolors --print-database'.
输出是一个shell命令去设置 LS_COLORS 环境变量.你能够指定shell语法来在命令行使用,或者 dircolors 将推测它是来自 SHELL 环境变量的值.
完成这个命令后, `ls --color' (可能已经alias 为 ls) 会以渴望的颜色列表文件.
选项
- -b, --sh, --bourne-shell
- 输出 Bourne shell 命令.如果设置了 SHELL 环境变量设置了和没有以 csh 或是 tcsh 结尾,这就是默认值.
- -c, --csh, --c-shell
- 输出C shell 命令. 如果 SHELL 以 csh 或 tcsh 结尾的时候是默认值.
- -p, --print-database
- 显示(已编译)的默认颜色配置数据库. 这个输出本身就是有效的配置文件并且相当清楚地描述了可能的情况.
GNU 标准选项
- --help
- 显示使用信息在标准输出并退出.
- --version
- 显示版本信息在标准输出并退出.
- --
- 结束选项列表.
环境(变量)
变量 SHELL and TERM 通常能从shell命令中正确找到. 变量LANG, LC_ALL, LC_CTYPE 和 LC_MESSAGES 有通常的意义. 变量LS_COLORS 被用于信息到 ls.
遵循
有色彩的 ls(1) 输出是一项 GNU 扩展. 这个实现和跟着最早的 Slackware Linux 发布的 dircolors/color-ls 包不太兼容. 尤其是没有提供对 Z shell 和 Korn shell 的支持.使用这些shells 应该使用 Bourne shell (-b) 模式.
参考
dir_colors(5), ls(1)
#p#
NAME
dircolors - color setup for ls
SYNOPSIS
dircolors [OPTION]... [FILE]
DESCRIPTION
Output commands to set the LS_COLORS environment variable.
Determine format of output:
- -b, --sh, --bourne-shell
- output Bourne shell code to set LS_COLORS
- -c, --csh, --c-shell
- output C shell code to set LS_COLORS
- -p, --print-database
- output defaults
- --help
- display this help and exit
- --version
- output version information and exit
If FILE is specified, read it to determine which colors to use for which file types and extensions. Otherwise, a precompiled database is used. For details on the format of these files, run `dircolors --print-database'.
AUTHOR
Written by H. Peter Anvin.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
The full documentation for dircolors is maintained as a Texinfo manual. If the info and dircolors programs are properly installed at your site, the command
- info coreutils dircolors
should give you access to the complete manual.