exa

Grid view

The grid view is the default view that exa uses if you don’t specify any options, though you can use --grid if you want to be specific.

Grid sizing

Each file name is displayed in a grid that fits within the current terminal window. The grid’s columns size themselves depending on the filenames being displayed.

For example, when listing a directory containing twelve files in a terminal 80 columns wide, exa will find that three columns of four rows each manages to fit within the window:

exa --grid
1. Blue-Purple Parallel Features.png  data control flow 2.png      Data tables.graffle
2. When Tests Fail.png                AWS pantaloons.graffle       Even more git diags.graffle
3. Long-Running Branch.png            data control flow 1.graffle  More git diagrams.graffle
4. Dependency Across Features.png     data control flow 2.graffle  Archive.zip

Changing the grid direction

The grid reads down then across by default: filenames are displayed in columns, and every file in a column will be sorted after the column to its left.

You can change the grid to read across then down with the -x or --across command-line options. This makes the rows of the grid in order: every file in a row will be ordered after the row preceding it.

exa --across
1. Blue-Purple Parallel Features.png  2. When Tests Fail.png       3. Long-Running Branch.png
4. Dependency Across Features.png     data control flow 2.png      AWS pantaloons.graffle
data control flow 1.graffle           data control flow 2.graffle  Data tables.graffle
Even more git diags.graffle           More git diagrams.graffle    Archive.zip

One line per file

The lines view is an alternate mode that displays one file per line. You can activate it with the --oneline or -1 command-line options.

It’s different from the long view in that it doesn’t display any of the files’ metadata, though it does show link targets.

exa --oneline *.png
1. Blue-Purple Parallel Features.png
2. When Tests Fail.png
3. Long-Running Branch.png
4. Dependency Across Features.png
data control flow 2.png

How do I change the width?

exa first checks the $COLUMNS environment variable before querying the terminal to find out the width. By setting this value manually, you can define your own terminal width.

COLUMNS=80 exa

How does this work when output is not to a terminal?

It doesn’t — if the output device has no width, then the --oneline view will be used instead, because it doesn’t wrap.

If you do need the output to wrap, then use the $COLUMNS trick above.