From LQWiki
Jump to navigation Jump to search


The dircolors command is designed to manipulate the colors used by the ls command.

Normal usage

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:

  1. with no file given on the command line, the output establishes the compiled-in defaults.
  2. a file named on the command line is read to define the colors, which are then incorporated in the output.

In this usage, output is normally a bash command, but the --csh switch will make it issue a csh command.

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.


Provided by the GNU Coreutils: man page

See Also

dir, ls, vdir

This article is a stub and needs to be finished. Plunge forward and help it grow!