The `EXA_COLORS` environment variable can be used to customise the colours that `eza` uses to highlight file names, file metadata, and parts of the UI.
You can use the `dircolors` program to generate a script that sets the variable from an input file, or if you don’t mind editing long strings of text, you can just type it out directly. These variables have the following structure:
- A list of key-value pairs separated by ‘`=`’, such as ‘`*.txt=32`’.
- Multiple ANSI formatting codes are separated by ‘`;`’, such as ‘`*.txt=32;1;4`’.
- Finally, multiple pairs are separated by ‘`:`’, such as ‘`*.txt=32:*.mp3=1;35`’.
The key half of the pair can either be a two-letter code or a file glob, and anything that’s not a valid code will be treated as a glob, including keys that happen to be two letters long.
EXAMPLES
========
`EXA_COLORS="uu=0:gu=0"`
: Disable the “current user” highlighting
`EXA_COLORS="da=32"`
: Turn the date column green
`EXA_COLORS="Vagrantfile=1;4;33"`
: Highlight Vagrantfiles
`EXA_COLORS="*.zip=38;5;125"`
: Override the existing zip colour
`EXA_COLORS="*.md=38;5;121:*.log=38;5;248"`
: Markdown files a shade of green, log files a shade of grey
LIST OF CODES
=============
`LS_COLORS` can use these ten codes:
`di`
: directories
`ex`
: executable files
`fi`
: regular files
`pi`
: named pipes
`so`
: sockets
`bd`
: block devices
`cd`
: character devices
`ln`
: symlinks
`or`
: symlinks with no target
`EXA_COLORS` can use many more:
`ur`
: the user-read permission bit
`uw`
: the user-write permission bit
`ux`
: the user-execute permission bit for regular files
`ue`
: the user-execute for other file kinds
`gr`
: the group-read permission bit
`gw`
: the group-write permission bit
`gx`
: the group-execute permission bit
`tr`
: the others-read permission bit
`tw`
: the others-write permission bit
`tx`
: the others-execute permission bit
`su`
: setuid, setgid, and sticky permission bits for files
`sf`
: setuid, setgid, and sticky for other file kinds
`xa`
: the extended attribute indicator
`sn`
: the numbers of a file’s size (sets `nb`, `nk`, `nm`, `ng` and `nh`)
`nb`
: the numbers of a file’s size if it is lower than 1 KB/Kib
`nk`
: the numbers of a file’s size if it is between 1 KB/KiB and 1 MB/MiB
`nm`
: the numbers of a file’s size if it is between 1 MB/MiB and 1 GB/GiB
`ng`
: the numbers of a file’s size if it is between 1 GB/GiB and 1 TB/TiB
`nt`
: the numbers of a file’s size if it is 1 TB/TiB or higher
`sb`
: the units of a file’s size (sets `ub`, `uk`, `um`, `ug` and `uh`)
`ub`
: the units of a file’s size if it is lower than 1 KB/Kib
`uk`
: the units of a file’s size if it is between 1 KB/KiB and 1 MB/MiB
`um`
: the units of a file’s size if it is between 1 MB/MiB and 1 GB/GiB
`ug`
: the units of a file’s size if it is between 1 GB/GiB and 1 TB/TiB
`ut`
: the units of a file’s size if it is 1 TB/TiB or higher
`df`
: a device’s major ID
`ds`
: a device’s minor ID
`uu`
: a user that’s you
`un`
: a user that’s someone else
`gu`
: a group that you belong to
`gn`
: a group you aren’t a member of
`lc`
: a number of hard links
`lm`
: a number of hard links for a regular file with at least two
Values in `EXA_COLORS` override those given in `LS_COLORS`, so you don’t need to re-write an existing `LS_COLORS` variable with proprietary extensions.
eza provides its own built-in set of file extension mappings that cover a large range of common file extensions, including documents, archives, media, and temporary files.
Any mappings in the environment variables will override this default set: running eza with `LS_COLORS="*.zip=32"` will turn zip files green but leave the colours of other compressed files alone.