exa

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. exa is written in Rust, so it's small, fast, and portable.

Screenshots

With no arguments, exa behaves like ls, listing files in a grid view:

$ exa
Cargo.lock  Cargo.toml  LICENCE  README.md  screenshot.png  src  target

With the -l argument, exa lists in long format, with one line per file and columns of each file's details:

$ exa -l
.rw-r--r-- 5.8K ben 21 Feb 13:53 -- Cargo.lock
.rw-r--r--  387 ben 13 Feb 21:21 -- Cargo.toml
.rw-r--r-- 1.1K ben 23 Nov 2014  -- LICENCE
.rw-r--r-- 1.7K ben 10 Feb 11:42 -M README.md
.rw-r--r-- 195K ben 18 Dec 2014  -- screenshot.png
drwxr-xr-x    - ben 13 Feb 12:41 -A src
drwx------    - ben 21 Feb 13:53 -- target

The permissions bits on the left are colour-coded to describe the meaning of each character, and the file size is formatted into bytes and kilobytes by default. The users column lists the username of the file's owner, and highlights it in yellow if it matches the current user ID. Finally, the column right before the filename lists a file or directory's Git status, where M means that the file has been modified, and A that the directory has had at least one file added to it.

exa has a lot more options than this. Another example, showing much more information about each file:

$ exa -bghHliS
  inode Permissions Links  Size  Blocks User Group Date Modified Git Name
6753938 .rw-r--r--      1 5.7Ki      16 ben  staff 21 Feb 13:53   -- Cargo.lock
6753939 .rw-r--r--      1   387       8 ben  staff 13 Feb 21:21   -- Cargo.toml
1971322 .rw-r--r--      1 1.1Ki       8 ben  staff 23 Nov 2014    -- LICENCE
6485598 .rw-r--r--      1 1.7Ki       8 ben  staff 10 Feb 11:42   -M README.md
3500869 .rw-r--r--      1 191Ki     384 ben  staff 18 Dec 2014    -- screenshot.png
1971325 drwxr-xr-x     10     -       - ben  staff 13 Feb 12:41   -A src
7262460 drwx------     11     -       - ben  staff 21 Feb 13:53   -- target

The -b flag gives the file sizes using SI (kibibyte) prefixes, rather than decimal ones. -g lists the group as well as the user, and like the user, is highlighted in yellow if your user is a member of this group. -H lists the number of hard links, and -S the number of filesystem blocks that the file takes up. -i lists the inode number at the start. Finally, -h inserts a header line at the beginning, as there are so many numbers involved here it's hard to tell which column means what!

Installation Instructions

exa is written in Rust. Although the language is still in development, exa will target the Nightly version until it stabilises.

  1. Download and install Rust Nightly for your platform.
  2. Install libgit2 and cmake using your favourite package management system (or pass --no-default-features to the next step)
  3. Run git clone https://github.com/ogham/exa.git to download the latest version of exa.
  4. Run cargo build in the new directory to compile exa.
  5. Move the resulting target/exa executable into a directory in your $PATH, or add an alias for it in your shell.

FAQ

Windows support?

Sorry, not yet — Although Rust is cross-platform, I don't have a Windows machine to develop on.

Any dependencies?

Git support depends on the libgit2 library, which in turn depends on openssl and cmake. If you are unable to install any of these, or you have them installed and it just refuses to compile for some reason, then you can disable Git support by passing --no-default-features to the cargo build command.

Fork me on GitHub