The dircolors command is designed to manipulate the colors used by the ls command.
The command is used by the .bashrc script to set up the LS_COLORS environment variable that ls uses to color its output. In this usage, the output is a shell command to set that variable. There are two cases:
- with no file given on the command line, the output establishes the compiled-in defaults.
- a file named on the command line is read to define the colors, which are then incorporated in the output.
Changing the colors
The -p (a.k.a. --print-database) switch causes a specification of the default colors to be output. This can be edited and used as input for the normal usage, generally by placing the edited file in the user's home directory as .dircolors and making it executable. Information about the format and meaning of the file are contained within it.