Convert manual pages to Markdown

This removes the "raw" man pages and converts them to Markdown, adding a build step using pandoc that converts them.

Having the man pages in Markdown makes them much, much easier to write and keep updated, at the cost of not having the raw formats easily available. Hopefully having the command to generate them in the Justfile will be enough.

It also splits out the EXA_COLORS environment variable into its own page, because it took up just under half of the one for the exa binary.
This commit is contained in:
Benjamin Sago 2020-10-13 20:19:00 +01:00
parent 002080cde8
commit 6eb5cee634
7 changed files with 541 additions and 501 deletions

View File

@ -42,3 +42,18 @@ all-release: build-release test-release
@versions:
rustc --version
cargo --version
# builds the man pages
@man:
mkdir -p "${CARGO_TARGET_DIR:-target}/man"
pandoc --standalone -f markdown -t man man/exa.1.md > "${CARGO_TARGET_DIR:-target}/man/exa.1"
pandoc --standalone -f markdown -t man man/exa_colors.5.md > "${CARGO_TARGET_DIR:-target}/man/exa_colors.5"
# builds and previews the main man page (exa.1)
@man-1-preview: man
man "${CARGO_TARGET_DIR:-target}/man/exa.1"
# builds and previews the colour configuration man page (exa_colors.5)
@man-5-preview: man
man "${CARGO_TARGET_DIR:-target}/man/exa_colors.5"

View File

@ -1,501 +0,0 @@
.hy
.TH "exa" "1" "2019\-07\-15" "exa 0.9.0" ""
.SH NAME
.PP
exa \- a modern replacement for ls
.SH SYNOPSIS
.PP
exa [\f[I]options\f[]] [\f[I]files\f[]]...
.SH DESCRIPTION
.PP
\f[C]exa\f[] is a modern replacement for \f[C]ls\f[].
It uses colours for information by default, helping you distinguish
between many types of files, such as whether you are the owner, or in
the owning group.
It also has extra features not present in the original \f[C]ls\f[], such
as viewing the Git status for a directory, or recursing into directories
with a tree view.
.SH DISPLAY OPTIONS
.TP
.B \-1, \-\-oneline
display one entry per line
.RS
.RE
.TP
.B \-G, \-\-grid
display entries as a grid (default)
.RS
.RE
.TP
.B \-l, \-\-long
display extended file metadata as a table
.RS
.RE
.TP
.B \-x, \-\-across
sort the grid across, rather than downwards
.RS
.RE
.TP
.B \-R, \-\-recurse
recurse into directories
.RS
.RE
.TP
.B \-T, \-\-tree
recurse into directories as a tree
.RS
.RE
.TP
.B \-F, \-\-classify
display type indicator by file names
.RS
.RE
.TP
.B \-\-color, \-\-colour=\f[I]WHEN\f[]
when to use terminal colours (always, automatic, never)
.RS
.RE
.TP
.B \-\-color-scale, \-\-colour-scale
highlight levels of file sizes distinctly
.RS
.RE
.TP
.B \-\-icons
display icons
.RS
.RE
.SH FILTERING AND SORTING OPTIONS
.TP
.B \-a, \-\-all
show hidden and \[aq]dot\[aq] files.
Use this twice to also show the \f[C].\f[] and \f[C]..\f[] directories.
.RS
.RE
.TP
.B \-d, \-\-list\-dirs
list directories like regular files
.RS
.RE
.TP
.B \-L, \-\-level=\f[I]DEPTH\f[]
limit the depth of recursion
.RS
.RE
.TP
.B \-r, \-\-reverse
reverse the sort order
.RS
.RE
.TP
.B \-s, \-\-sort=\f[I]SORT_FIELD\f[]
which field to sort by.
Valid fields are name, Name, extension, Extension, size, modified, changed, accessed, created, inode, type, and none.
The modified field has the aliases date, time, and newest, and its reverse order has the aliases age and oldest.
Fields starting with a capital letter will sort uppercase before lowercase: 'A' then 'B' then 'a' then 'b'.
Fields starting with a lowercase letter will mix them: 'A' then 'a' then 'B' then 'b'.
.RS
.RE
.TP
.B \-I, \-\-ignore\-glob=\f[I]GLOBS\f[]
Glob patterns, pipe-separated, of files to ignore
.RS
.RE
.TP
.B \-\-git\-ignore
ignore files mentioned in '.gitignore'
.RS
.RE
.TP
.B \-\-group\-directories\-first
list directories before other files
.RS
.RE
.TP
.B \-D, \-\-only\-dirs
list only directories
.RS
.RE
.SH LONG VIEW OPTIONS
.PP
These options are available when running with \f[C]\-\-long\f[]
(\f[C]\-l\f[]):
.TP
.B \-b, \-\-binary
list file sizes with binary prefixes
.RS
.RE
.TP
.B \-B, \-\-bytes
list file sizes in bytes, without any prefixes
.RS
.RE
.TP
.B \-\-changed
use the changed timestamp field
.RS
.RE
.TP
.B \-g, \-\-group
list each file\[aq]s group
.RS
.RE
.TP
.B \-h, \-\-header
add a header row to each column
.RS
.RE
.TP
.B \-H, \-\-links
list each file\[aq]s number of hard links
.RS
.RE
.TP
.B \-i, \-\-inode
list each file\[aq]s inode number
.RS
.RE
.TP
.B \-m, \-\-modified
use the modified timestamp field
.RS
.RE
.TP
.B \-S, \-\-blocks
list each file\[aq]s number of file system blocks
.RS
.RE
.TP
.B \-t, \-\-time=\f[I]WORD\f[]
which timestamp field to list (modified, changed, accessed, created)
.RS
.RE
.TP
.B \-\-time\-style=\f[I]STYLE\f[]
how to format timestamps (default, iso, long-iso, full-iso)
.RS
.RE
.TP
.B \-u, \-\-accessed
use the accessed timestamp field
.RS
.RE
.TP
.B \-U, \-\-created
use the created timestamp field
.RS
.RE
.TP
.B \-\-no\-permissions
suppress the permissions field
.RS
.RE
.TP
.B \-\-no\-filesize
suppress the filesize field
.RS
.RE
.TP
.B \-\-no\-user
suppress the user field
.RS
.RE
.TP
.B \-\-no\-time
suppress the time field
.RS
.RE
.TP
.B \-\@, \-\-extended
list each file\[aq]s extended attributes and sizes
.RS
.RE
.TP
.B \-\-git
list each file\[aq]s Git status, if tracked
.RS
.RE
.SH EXAMPLES
.PP
To display a list of files, with the largest at the top:
.IP
.nf
\f[C]
exa\ \-\-reverse\ \-\-sort=size
\f[]
.fi
.PP
To display a tree of files, three levels deep:
.IP
.nf
\f[C]
exa\ \-\-long\ \-\-tree\ \-\-level=3
\f[]
.fi
.SH ENVIRONMENT VARIABLES
.PP
exa responds to the following environment variables:
.SS \f[C]COLUMNS\f[]
.PP
Overrides the width of the terminal, in characters.
For example, \f[C]COLUMNS=80\ exa\f[] will show a grid view with a
maximum width of 80 characters.
.PP
This option won\[aq]t do anything when exa\[aq]s output doesn\[aq]t
wrap, such as when using the \f[C]\-\-long\f[] view.
.SS \f[C]EXA_STRICT\f[]
.PP
Enables \f[I]strict mode\f[], which will make exa error when two
command\-line options are incompatible.
Usually, options can override each other going right\-to\-left on the
command line, so that exa can be given aliases: creating an alias
\f[C]exa=exa\ \-\-sort=ext\f[] then running \f[C]exa\ \-\-sort=size\f[]
with that alias will run \f[C]exa\ \-\-sort=ext\ \-\-sort=size\f[], and
the sorting specified by the user will override the sorting specified by
the alias.
In strict mode, the two options will not co\-operate, and exa will
error.
.PP
This option is intended for use with automated scripts and other
situations where you want to be \f[I]certain\f[] you\[aq]re typing in
the right command.
.SS \f[C]EXA_GRID_ROWS\f[]
.PP
Limits the grid\-details view (\f[C]exa\ \-\-grid\ \-\-long\f[]) so
it\[aq]s only activated when at least the given number of rows of output
would be generated.
With widescreen displays, it\[aq]s possible for the grid to look very
wide and sparse, on just one or two lines with none of the columns
lining up.
By specifying a minimum number of rows, you can only use the view if
it\[aq]s going to be worth using.
.SS \f[C]LS_COLORS\f[] and \f[C]EXA_COLORS\f[]
.PP
The \f[C]EXA_COLORS\f[] variable is the traditional way of customising
the colours used by \f[C]ls\f[].
.PP
You can use the \f[C]dircolors\f[] program to generate a script that
sets the variable from an input file, or if you don\[aq]t mind editing
long strings of text, you can just type it out directly.
These variables have the following structure:
.IP \[bu] 2
A list of key\-value pairs separated by \f[C]=\f[], such as
\f[C]*.txt=32\f[].
.IP \[bu] 2
Multiple ANSI formatting codes are separated by \f[C];\f[], such as
\f[C]*.txt=32;1;4\f[].
.IP \[bu] 2
Finally, multiple pairs are separated by \f[C]:\f[], such as
\f[C]*.txt=32:*.mp3=1;35\f[].
.PP
The key half of the pair can either be a two\-letter code or a file
glob, and anything that\[aq]s not a valid code will be treated as a
glob, including keys that happen to be two letters long.
.PP
\f[C]LS_COLORS\f[] can use these ten codes:
.IP \[bu] 2
\f[B]di\f[], directories
.IP \[bu] 2
\f[B]ex\f[], executable files
.IP \[bu] 2
\f[B]fi\f[], regular files
.IP \[bu] 2
\f[B]pi\f[], named pipes
.IP \[bu] 2
\f[B]so\f[], sockets
.IP \[bu] 2
\f[B]bd\f[], block devices
.IP \[bu] 2
\f[B]cd\f[], character devices
.IP \[bu] 2
\f[B]ln\f[], symlinks
.IP \[bu] 2
\f[B]or\f[], symlinks with no target
.PP
\f[C]EXA_COLORS\f[] can use many more:
.IP \[bu] 2
\f[B]ur\f[], the user\-read permission bit
.IP \[bu] 2
\f[B]uw\f[], the user\-write permission bit
.IP \[bu] 2
\f[B]ux\f[], the user\-execute permission bit for regular files
.IP \[bu] 2
\f[B]ue\f[], the user\-execute for other file kinds
.IP \[bu] 2
\f[B]gr\f[], the group\-read permission bit
.IP \[bu] 2
\f[B]gw\f[], the group\-write permission bit
.IP \[bu] 2
\f[B]gx\f[], the group\-execute permission bit
.IP \[bu] 2
\f[B]tr\f[], the others\-read permission bit
.IP \[bu] 2
\f[B]tw\f[], the others\-write permission bit
.IP \[bu] 2
\f[B]tx\f[], the others\-execute permission bit
.IP \[bu] 2
\f[B]su\f[], setuid, setgid, and sticky permission bits for files
.IP \[bu] 2
\f[B]sf\f[], setuid, setgid, and sticky for other file kinds
.IP \[bu] 2
\f[B]xa\f[], the extended attribute indicator
.IP \[bu] 2
\f[B]sn\f[], the numbers of a file\[aq]s size (sets nb, nk, nm, ng and nh)
.IP \[bu] 2
\f[B]nb\f[], the numbers of a file\[aq]s size if it is lower than 1 KB/Kib
.IP \[bu] 2
\f[B]nk\f[], the numbers of a file\[aq]s size if it is between 1 KB/KiB and 1 MB/MiB
.IP \[bu] 2
\f[B]nm\f[], the numbers of a file\[aq]s size if it is between 1 MB/MiB and 1 GB/GiB
.IP \[bu] 2
\f[B]ng\f[], the numbers of a file\[aq]s size if it is between 1 GB/GiB and 1 TB/TiB
.IP \[bu] 2
\f[B]nt\f[], the numbers of a file\[aq]s size if it is 1 TB/TiB or higher
.IP \[bu] 2
\f[B]sb\f[], the units of a file\[aq]s size (sets ub, uk, um, ug and uh)
.IP \[bu] 2
\f[B]ub\f[], the units of a file\[aq]s size if it is lower than 1 KB/Kib
.IP \[bu] 2
\f[B]uk\f[], the units of a file\[aq]s size if it is between 1 KB/KiB and 1 MB/MiB
.IP \[bu] 2
\f[B]um\f[], the units of a file\[aq]s size if it is between 1 MB/MiB and 1 GB/GiB
.IP \[bu] 2
\f[B]ug\f[], the units of a file\[aq]s size if it is between 1 GB/GiB and 1 TB/TiB
.IP \[bu] 2
\f[B]ut\f[], the units of a file\[aq]s size if it is 1 TB/TiB or higher
.IP \[bu] 2
\f[B]df\f[], a device\[aq]s major ID
.IP \[bu] 2
\f[B]ds\f[], a device\[aq]s minor ID
.IP \[bu] 2
\f[B]uu\f[], a user that\[aq]s you
.IP \[bu] 2
\f[B]un\f[], a user that\[aq]s someone else
.IP \[bu] 2
\f[B]gu\f[], a group that you belong to
.IP \[bu] 2
\f[B]gn\f[], a group you aren\[aq]t a member of
.IP \[bu] 2
\f[B]lc\f[], a number of hard links
.IP \[bu] 2
\f[B]lm\f[], a number of hard links for a regular file with at least two
.IP \[bu] 2
\f[B]ga\f[], a new flag in Git
.IP \[bu] 2
\f[B]gm\f[], a modified flag in Git
.IP \[bu] 2
\f[B]gd\f[], a deleted flag in Git
.IP \[bu] 2
\f[B]gv\f[], a renamed flag in Git
.IP \[bu] 2
\f[B]gt\f[], a modified metadata flag in Git
.IP \[bu] 2
\f[B]xx\f[], "punctuation", including many background UI elements
.IP \[bu] 2
\f[B]da\f[], a file\[aq]s date
.IP \[bu] 2
\f[B]in\f[], a file\[aq]s inode number
.IP \[bu] 2
\f[B]bl\f[], a file\[aq]s number of blocks
.IP \[bu] 2
\f[B]hd\f[], the header row of a table
.IP \[bu] 2
\f[B]lp\f[], the path of a symlink
.IP \[bu] 2
\f[B]cc\f[], an escaped character in a filename
.IP \[bu] 2
\f[B]bO\f[], the overlay style for broken symlink paths
.PP
Values in \f[C]EXA_COLORS\f[] override those given in
\f[C]LS_COLORS\f[], so you don\[aq]t need to re\-write an existing
\f[C]LS_COLORS\f[] variable with proprietary extensions.
.PP
Unlike some versions of \f[C]ls\f[], the given ANSI values must be valid
colour codes: exa won\[aq]t just print out whichever characters are
given.
The codes accepted by exa are:
.IP \[bu] 2
\f[C]1\f[], for bold
.IP \[bu] 2
\f[C]4\f[], for underline
.IP \[bu] 2
\f[C]31\f[], for red text
.IP \[bu] 2
\f[C]32\f[], for green text
.IP \[bu] 2
\f[C]33\f[], for yellow text
.IP \[bu] 2
\f[C]34\f[], for blue text
.IP \[bu] 2
\f[C]35\f[], for purple text
.IP \[bu] 2
\f[C]36\f[], for cyan text
.IP \[bu] 2
\f[C]37\f[], for white text
.IP \[bu] 2
\f[C]38;5;\f[]\f[I]\f[C]nnn\f[]\f[], for a colour from 0 to 255 (replace
the \f[I]nnn\f[] part)
.PP
Many terminals will treat bolded text as a different colour, or at least
provide the option to.
.PP
exa 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 exa with \f[C]LS_COLORS="*.zip=32"\f[] will turn zip files
green but leave the colours of other compressed files alone.
.PP
You can also disable this built\-in set entirely by including a
\f[C]reset\f[] entry at the beginning of \f[C]EXA_COLORS\f[].
So setting \f[C]EXA_COLORS="reset:*.txt=31"\f[] will highlight only text
files; setting \f[C]EXA_COLORS="reset"\f[] will highlight nothing.
.SS Examples
.IP \[bu] 2
Disable the "current user" highlighting: \f[C]EXA_COLORS="uu=0:gu=0"\f[]
.IP \[bu] 2
Turn the date column green: \f[C]EXA_COLORS="da=32"\f[]
.IP \[bu] 2
Highlight Vagrantfiles: \f[C]EXA_COLORS="Vagrantfile=1;4;33"\f[]
.IP \[bu] 2
Override the existing zip colour: \f[C]EXA_COLORS="*.zip=38;5;125"\f[]
.IP \[bu] 2
Markdown files a shade of green, log files a shade of grey:
\f[C]EXA_COLORS="*.md=38;5;121:*.log=38;5;248"\f[]
.SS BUILT\-IN EXTENSIONS
.IP \[bu] 2
"Immediate" files are the files you should look at when downloading and
building a project for the first time: READMEs, Makefiles, Cargo.toml,
and others.
They\[aq]re highlighted in yellow and underlined.
.IP \[bu] 2
Images (png, jpeg, gif) are purple.
.IP \[bu] 2
Videos (mp4, ogv, m2ts) are a slightly purpler purple.
.IP \[bu] 2
Music (mp3, m4a, ogg) is a deeper purple.
.IP \[bu] 2
Lossless music (flac, alac, wav) is deeper than \f[I]that\f[] purple.
In general, most media files are some shade of purple.
.IP \[bu] 2
Cryptographic files (asc, enc, p12) are a faint blue.
.IP \[bu] 2
Documents (pdf, doc, dvi) are a less faint blue.
.IP \[bu] 2
Compressed files (zip, tgz, Z) are red.
.IP \[bu] 2
Temporary files (tmp, swp, ~) are grey.
.IP \[bu] 2
Compiled files (class, o, pyc) are faint orange.
A file is also counted as compiled if it uses a common extension and is
in the same directory as one of its source files: \[aq]styles.css\[aq]
will count as compiled when next to \[aq]styles.less\[aq] or
\[aq]styles.sass\[aq], and \[aq]scripts.js\[aq] when next to
\[aq]scripts.ts\[aq] or \[aq]scripts.coffee\[aq].
.SH AUTHOR
.PP
\f[C]exa\f[] is maintained by Benjamin \[aq]ogham\[aq] Sago and many
other contributors.
You can view the full list at
<https://github.com/ogham/exa/graphs/contributors>.

244
man/exa.1.md Normal file
View File

@ -0,0 +1,244 @@
% exa(1) v0.9.0
<!-- This is the exa(1) man page, written in Markdown. -->
<!-- To generate the roff version, run `just man`, -->
<!-- and the man page will appear in the target directory. -->
NAME
====
exa — a modern replacement for ls
SYNOPSIS
========
`exa [options] [files...]`
**exa** is a modern replacement for `ls`.
It uses colours for information by default, helping you distinguish between many types of files, such as whether you are the owner, or in the owning group.
It also has extra features not present in the original `ls`, such as viewing the Git status for a directory, or recursing into directories with a tree view.
EXAMPLES
========
`exa`
: Lists the contents of the current directory in a grid.
`exa --oneline --reverse --sort=size`
: Displays a list of files with the largest at the top.
`exa --long --header --inode --git`
: Displays a table of files with a header, showing each files metadata, inode, and Git status.
`exa --long --tree --level=3`
: Displays a tree of files, three levels deep, as well as each files metadata.
DISPLAY OPTIONS
===============
`-1`, `--oneline`
: Display one entry per line.
`-F`, `--classify`
: Display file kind indicators next to file names.
`-G`, `--grid`
: Display entries as a grid (default).
`-l`, `--long`
: Display extended file metadata as a table.
`-R`, `--recurse`
: Recurse into directories.
`-T`, `--tree`
: Recurse into directories as a tree.
`-x`, `--across`
: Sort the grid across, rather than downwards.
`--color`, `--colour=WHEN`
: When to use terminal colours.
Valid settings are `always`, `automatic`, and `never`.
`--color-scale`, `--colour-scale`
: Colour file sizes on a scale.
`--icons`
: Display icons next to file names.
FILTERING AND SORTING OPTIONS
=============================
`-a`, `--all`
: Show hidden and “dot” files.
Use this twice to also show the `.` and `..` directories.
`-d`, `--list-dirs`
: List directories like regular files.
`-L`, `--level=DEPTH`
: Limit the depth of recursion.
`-r`, `--reverse`
: Reverse the sort order.
`-s`, `--sort=SORT_FIELD`
: Which field to sort by.
Valid sort fields are `name`, `Name`, `extension`, `Extension`, `size`, `modified`, `changed`, `accessed`, `created`, `inode`, `type`, and `none`.
The `modified` sort field has the aliases `date`, `time`, and `newest`, and its reverse order has the aliases `age` and `oldest`.
Sort fields starting with a capital letter will sort uppercase before lowercase: A then B then a then b. Fields starting with a lowercase letter will mix them: A then a then B then b.
`-I`, `--ignore-glob=GLOBS`
: Glob patterns, pipe-separated, of files to ignore.
`--git-ignore`
: Do not list files that are ignored by Git.
`--group-directories-first`
: List directories before other files.
`-D`, `--only-dirs`
: List only directories, not files.
LONG VIEW OPTIONS
=================
These options are available when running with `--long` (`-l`):
`-b`, `--binary`
: List file sizes with binary prefixes.
`-B`, `--bytes`
: List file sizes in bytes, without any prefixes.
`--changed`
: Use the changed timestamp field.
`-g`, `--group`
: List each files group.
`-h`, `--header`
: Add a header row to each column.
`-H`, `--links`
: List each files number of hard links.
`-i`, `--inode`
: List each files inode number.
`-m`, `--modified`
: Use the modified timestamp field.
`-S`, `--blocks`
: List each files number of file system blocks.
`-t`, `--time=WORD`
: Which timestamp field to list.
: Valid timestamp fields are `modified`, `changed`, `accessed`, and `created`.
`--time-style=STYLE`
: How to format timestamps.
: Valid timestamp styles are `default`, `iso`, `long-iso`, and `full-iso`.
`-u`, `--accessed`
: Use the accessed timestamp field.
`-U`, `--created`
: Use the created timestamp field.
`--no-permissions`
: Suppress the permissions field.
`--no-filesize`
: Suppress the file size field.
`--no-user`
: Suppress the user field.
`--no-time`
: Suppress the time field.
`-@`, `--extended`
: List each files extended attributes and sizes.
`--git`
: List each files Git status, if tracked.
ENVIRONMENT VARIABLES
=====================
exa responds to the following environment variables:
## `COLUMNS`
Overrides the width of the terminal, in characters.
For example, `COLUMNS=80 exa` will show a grid view with a maximum width of 80 characters.
This option wont do anything when exas output doesnt wrap, such as when using the `--long` view.
## `EXA_STRICT`
Enables _strict mode_, which will make exa error when two command-line options are incompatible.
Usually, options can override each other going right-to-left on the command line, so that exa can be given aliases: creating an alias `exa=exa --sort=ext` then running `exa --sort=size` with that alias will run `exa --sort=ext --sort=size`, and the sorting specified by the user will override the sorting specified by the alias.
In strict mode, the two options will not co-operate, and exa will error.
This option is intended for use with automated scripts and other situations where you want to be certain youre typing in the right command.
## `EXA_GRID_ROWS`
Limits the grid-details view (`exa --grid --long`) so its only activated when at least the given number of rows of output would be generated.
With widescreen displays, its possible for the grid to look very wide and sparse, on just one or two lines with none of the columns lining up.
By specifying a minimum number of rows, you can only use the view if its going to be worth using.
## `LS_COLORS`, `EXA_COLORS`
Specifies the colour scheme used to highlight files based on their name and kind, as well as highlighting metadata and parts of the UI.
For more information on the format of these environment variables, see the `exa_colors(5)` manual page.
EXIT STATUSES
=============
0
: If everything goes OK.
1
: If there was an I/O error during operation.
3
: If there was a problem with the command-line arguments.
AUTHOR
======
exa is maintained by Benjamin ogham Sago and many other contributors.
**Website:** `https://the.exa.website/` \
**Source code:** `https://github.com/ogham/exa` \
**Contributors:** `https://github.com/ogham/exa/graphs/contributors`
SEE ALSO
========
- `exa_colors(5)`

282
man/exa_colors.5.md Normal file
View File

@ -0,0 +1,282 @@
% exa_colors(5) v0.9.0
<!-- This is the exa_colors(5) man page, written in Markdown. -->
<!-- To generate the roff version, run `just man`, -->
<!-- and the man page will appear in the target directory. -->
NAME
====
exa_colors — customising the file and UI colours of exa
SYNOPSIS
========
The `EXA_COLORS` environment variable can be used to customise the colours that `exa` 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 dont 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 thats 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 files size (sets `nb`, `nk`, `nm`, `ng` and `nh`)
`nb`
: the numbers of a files size if it is lower than 1 KB/Kib
`nk`
: the numbers of a files size if it is between 1 KB/KiB and 1 MB/MiB
`nm`
: the numbers of a files size if it is between 1 MB/MiB and 1 GB/GiB
`ng`
: the numbers of a files size if it is between 1 GB/GiB and 1 TB/TiB
`nt`
: the numbers of a files size if it is 1 TB/TiB or higher
`sb`
: the units of a files size (sets `ub`, `uk`, `um`, `ug` and `uh`)
`ub`
: the units of a files size if it is lower than 1 KB/Kib
`uk`
: the units of a files size if it is between 1 KB/KiB and 1 MB/MiB
`um`
: the units of a files size if it is between 1 MB/MiB and 1 GB/GiB
`ug`
: the units of a files size if it is between 1 GB/GiB and 1 TB/TiB
`ut`
: the units of a files size if it is 1 TB/TiB or higher
`df`
: a devices major ID
`ds`
: a devices minor ID
`uu`
: a user thats you
`un`
: a user thats someone else
`gu`
: a group that you belong to
`gn`
: a group you arent a member of
`lc`
: a number of hard links
`lm`
: a number of hard links for a regular file with at least two
`ga`
: a new flag in Git
`gm`
: a modified flag in Git
`gd`
: a deleted flag in Git
`gv`
: a renamed flag in Git
`gt`
: a modified metadata flag in Git
`xx`
: “punctuation”, including many background UI elements
`da`
: a files date
`in`
: a files inode number
`bl`
: a files number of blocks
`hd`
: the header row of a table
`lp`
: the path of a symlink
`cc`
: an escaped character in a filename
`bO`
: the overlay style for broken symlink paths
Values in `EXA_COLORS` override those given in `LS_COLORS`, so you dont need to re-write an existing `LS_COLORS` variable with proprietary extensions.
LIST OF STYLES
==============
Unlike some versions of `ls`, the given ANSI values must be valid colour codes: exa wont just print out whichever characters are given.
The codes accepted by exa are:
`1`
: for bold
`4`
: for underline
`31`
: for red text
`32`
: for green text
`33`
: for yellow text
`34`
: for blue text
`35`
: for purple text
`36`
: for cyan text
`37`
: for white text
`38;5;nnn`
: for a colour from 0 to 255 (replace the `nnn` part)
Many terminals will treat bolded text as a different colour, or at least provide the option to.
exa 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 exa with `LS_COLORS="*.zip=32"` will turn zip files green but leave the colours of other compressed files alone.
You can also disable this built-in set entirely by including a `reset` entry at the beginning of `EXA_COLORS`.
So setting `EXA_COLORS="reset:*.txt=31"` will highlight only text files; setting `EXA_COLORS="reset"` will highlight nothing.
AUTHOR
======
exa is maintained by Benjamin ogham Sago and many other contributors.
**Website:** `https://the.exa.website/` \
**Source code:** `https://github.com/ogham/exa` \
**Contributors:** `https://github.com/ogham/exa/graphs/contributors`
SEE ALSO
========
- `exa(1)`