Name
dircolors
Synopsis
dircolors [options] [file]
Set the color options for the ls command. dircolors outputs shell commands which, when evaluated, update the LS_COLORS environment variable. If you specify a file, dircolors reads it to determine which colors to use. Otherwise, it uses a default set of colors. If the shell is not specified, dircolors checks the SHELL environment variable.
Options
The program takes three options in addition to the standard --help and --version flags:
- -b, --sh, --bourne-shell
Use the Bourne shell syntax when setting the LS_COLORS variable.
- -c, --csh, --c-shell
Use csh (C shell) syntax when setting the LS_COLORS variable.
- -p, --print-database
Display the default colors. You can copy this information into a file and change it to suit your preferences, and then run the program with the file as its argument to set the colors to your new values.
Example
Set LS_COLORS using the default color database:
eval `dircolors`
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access