{
    "mode": "info",
    "parameter": "dircolors",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/dircolors/json",
    "generated": "2026-11-14T14:08:51Z",
    "sections": {
        "File: coreutils.info,  Node: dircolors invocation,  Prev: vdir invocation,  Up: Directory listing": {
            "content": "",
            "subsections": [
                {
                    "name": "10.4 'dircolors': Color setup for 'ls'",
                    "content": "'dircolors' outputs a sequence of shell commands to set up the terminal\nfor color output from 'ls' (and 'dir', etc.).  Typical usage:\n\neval \"$(dircolors [OPTION]... [FILE])\"\n\nIf FILE is specified, 'dircolors' reads it to determine which colors\nto use for which file types and extensions.  Otherwise, a precompiled\ndatabase is used.  For details on the format of these files, run\n'dircolors --print-database'.\n\nTo make 'dircolors' read a '~/.dircolors' file if it exists, you can\nput the following lines in your '~/.bashrc' (or adapt them to your\nfavorite shell):\n\nd=.dircolors\ntest -r $d && eval \"$(dircolors $d)\"\n\nThe output is a shell command to set the 'LSCOLORS' environment\nvariable.  You can specify the shell syntax to use on the command line,\nor 'dircolors' will guess it from the value of the 'SHELL' environment\nvariable.\n\nThe program accepts the following options.  Also see *note Common\noptions::.\n\n'-b'\n'--sh'\n'--bourne-shell'\nOutput Bourne shell commands.  This is the default if the 'SHELL'\nenvironment variable is set and does not end with 'csh' or 'tcsh'.\n\n'-c'\n'--csh'\n'--c-shell'\nOutput C shell commands.  This is the default if 'SHELL' ends with\n'csh' or 'tcsh'.\n\n'-p'\n'--print-database'\nPrint the (compiled-in) default color configuration database.  This\noutput is itself a valid configuration file, and is fairly\ndescriptive of the possibilities.\n\n'--print-ls-colors'\nPrint the LSCOLORS entries on separate lines, each colored as per\nthe color they represent.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}