exa a modern replacement for ls written in rust for Linux/Unix

ls is a command to show files in Linux and Unix-like operating systems. A ls command first appeared in a version of AT&T UNIX as well as in Multics. BSD and GNU Coreutils package provides the ls command with minor syntax changes. There is now third alternative named exa. It is a modern replacement for ls.
exa
The exa uses colors 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. The exa command written in Rust, so it’s small, fast, and portable.

Features of exa

  1. By default exa use the colors.
  2. It can display a file’s extended attributes, as well as standard filesystem information such as the inode, the number of blocks, and a file’s various dates and times.
  3. Tree view
  4. Git support: View the staged and unstaged status of every file, right there in the standard view. Also works in tree view.
  5. It queries files in parallel, giving you performance on par with ls.

Installation

One can install exa from the source code or use a package manager.

Install exa on macos

Use the brew command:
$ brew update && brew upgrade
$ brew cleanup
$ brew install exa

Sample outputs:

==> Downloading https://homebrew.bintray.com/bottles/exa-0.7.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring exa-0.7.0.sierra.bottle.tar.gz
==> Using the sandbox
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
 
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
 
fish completions have been installed to:
  /usr/local/share/fish/vendor_completions.d
==> Summary
  /usr/local/Cellar/exa/0.7.0: 9 files, 1.2MB

==> Downloading https://homebrew.bintray.com/bottles/exa-0.7.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring exa-0.7.0.sierra.bottle.tar.gz
==> Using the sandbox
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.dzsh completions have been installed to:
/usr/local/share/zsh/site-functionsfish completions have been installed to:
/usr/local/share/fish/vendor_completions.d
==> Summary
/usr/local/Cellar/exa/0.7.0: 9 files, 1.2MB

Install exa on an Arch Linux

Use the yaourt command:
# yaourt -S exa-git

Install exa using source code

To install Rust, run the following in your terminal, then follow the onscreen instructions:
$ curl https://sh.rustup.rs -sSf | sh
Install libgit2 and cmake using apt-get command/apt command:
$ sudo apt-get install libgit2-dev cmake git libhttp-parser2.1
To download the latest version, run:
$ git clone https://github.com/ogham/exa.git
Run make install in the new directory to compile and install exa into /usr/local/bin:
$ make install

Install exa using binary method on any Linux distro

Make sure you install libhttp-parser:
$ sudo apt-get install libhttp-parser2.1
$ wget https://the.exa.website/releases/exa-linux-x86_64-0.7.0.zip
$ unzip exa-linux-x86_64-0.7.0.zip
$ sudo mv exa-linux-x86_64 /usr/local/bin/

How do I use exa?

Simply type the exa command:
$ exa
$ exa -l
$ exa -l /etc/

Sample outputs:

Fig.01 exa in action
Fig.01 exa in action

The -l option displays extended file metadata as a table. Try another example:
$ exa -bghHliS
Sample outputs:

Fig.02 exa command
Fig.02 exa command

Getting help about exa command

Type the following command:
$ exa --help
Sample outputs:

Usage:
  exa [options] [files...]
 
  -?, --help         show list of command-line options
  -v, --version      show version of exa
 
DISPLAY OPTIONS
  -1, --oneline      display one entry per line
  -l, --long         display extended file metadata as a table
  -G, --grid         display entries as a grid (default)
  -x, --across       sort the grid across, rather than downwards
  -R, --recurse      recurse into directories
  -T, --tree         recurse into directories as a tree
  -F, --classify     display type indicator by file names
  --colo[u]r=WHEN    when to use terminal colours (always, auto, never)
  --colo[u]r-scale   highlight levels of file sizes distinctly
 
FILTERING AND SORTING OPTIONS
  -a, --all                  show hidden and 'dot' files
  -d, --list-dirs            list directories like regular files
  -r, --reverse              reverse the sort order
  -s, --sort SORT_FIELD      which field to sort by:
  --group-directories-first  list directories before other files
  -I, --ignore-glob GLOBS    glob patterns (pipe-separated) of files to ignore
  Valid sort fields:         name, Name, extension, Extension, size, type,
                             modified, accessed, created, inode, none
 
LONG VIEW OPTIONS
  -b, --binary       list file sizes with binary prefixes
  -B, --bytes        list file sizes in bytes, without any prefixes
  -g, --group        list each file's group
  -h, --header       add a header row to each column
  -H, --links        list each file's number of hard links
  -i, --inode        list each file's inode number
  -L, --level DEPTH  limit the depth of recursion
  -m, --modified     use the modified timestamp field
  -S, --blocks       show number of file system blocks
  -t, --time FIELD   which timestamp field to list (modified, accessed, created)
  -u, --accessed     use the accessed timestamp field
  -U, --created      use the created timestamp field
  --time-style       how to format timestamps (default, iso, long-iso, full-iso)
  --git              list each file's Git status, if tracked
  -@, --extended     list each file's extended attributes and sizes

Usage:
exa [options] [files…]-?, –help show list of command-line options
-v, –version show version of exaDISPLAY OPTIONS
-1, –oneline display one entry per line
-l, –long display extended file metadata as a table
-G, –grid display entries as a grid (default)
-x, –across sort the grid across, rather than downwards
-R, –recurse recurse into directories
-T, –tree recurse into directories as a tree
-F, –classify display type indicator by file names
–colo[u]r=WHEN when to use terminal colours (always, auto, never)
–colo[u]r-scale highlight levels of file sizes distinctlyFILTERING AND SORTING OPTIONS
-a, –all show hidden and ‘dot’ files
-d, –list-dirs list directories like regular files
-r, –reverse reverse the sort order
-s, –sort SORT_FIELD which field to sort by:
–group-directories-first list directories before other files
-I, –ignore-glob GLOBS glob patterns (pipe-separated) of files to ignore
Valid sort fields: name, Name, extension, Extension, size, type,
modified, accessed, created, inode, noneLONG VIEW OPTIONS
-b, –binary list file sizes with binary prefixes
-B, –bytes list file sizes in bytes, without any prefixes
-g, –group list each file’s group
-h, –header add a header row to each column
-H, –links list each file’s number of hard links
-i, –inode list each file’s inode number
-L, –level DEPTH limit the depth of recursion
-m, –modified use the modified timestamp field
-S, –blocks show number of file system blocks
-t, –time FIELD which timestamp field to list (modified, accessed, created)
-u, –accessed use the accessed timestamp field
-U, –created use the created timestamp field
–time-style how to format timestamps (default, iso, long-iso, full-iso)
–git list each file’s Git status, if tracked
-@, –extended list each file’s extended attributes and sizes

Conclusion

The exa comes with saner defaults than ls. However, I will not install it on my server. It might be a good choice for your laptop or desktop computer. For more info see exa home page/exa project.

 

Source