LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

dircolors

color scheme configurator for ls

TLDR

Output shell commands to set LS_COLORS
$ dircolors
copy
Use a specific database file
$ dircolors [/path/to/dircolors.db]
copy
Output for Bourne shell
$ dircolors -b
copy
Output for C shell
$ dircolors -c
copy
Print default database
$ dircolors -p
copy

SYNOPSIS

dircolors [options] [file]

DESCRIPTION

dircolors outputs shell commands to set the LS_COLORS environment variable, which controls the colors used by ls and other tools. It reads a configuration file that maps file types and extensions to colors.Typically invoked in shell configuration files: eval "$(dircolors)".

PARAMETERS

-b, --sh, --bourne-shell

Output Bourne shell commands.
-c, --csh, --c-shell
Output C shell commands.
-p, --print-database
Print the default database.

CONFIGURATION

~/.dircolors or ~/.dir_colors

User-specific color configuration database mapping file types and extensions to colors.
/etc/DIR_COLORS
System-wide default color configuration.

INSTALL

sudo apt install coreutils
copy
sudo dnf install coreutils
copy
sudo pacman -S coreutils
copy
sudo apk add coreutils
copy
sudo zypper install coreutils
copy
brew install coreutils
copy
nix profile install nixpkgs#coreutils
copy

CAVEATS

Output must be evaluated by the shell (e.g., `eval "$(dircolors)"`) to take effect. The default database covers common file types; customize with `dircolors -p > ~/.dircolors` and edit. Only affects tools that read LS_COLORS (primarily GNU ls and compatible tools).

HISTORY

dircolors is part of GNU coreutils and has been included in Linux distributions since the early days of colorized terminal output.

SEE ALSO

ls(1), dir(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid