Exa – A Modern And Colorful Replacement For LS Command Written In Rust

ls is one of the very basic & essential Linux command for administrator that can be used in most of the actions (in other hands, Linux administrator can’t live without ls command). Exa is a small, fast, portable, modern and colorful replacement for ls command which was written in rust language.

One of the special feature in exa is colors, by default it uses colors for output that will distinguish individual files, folders and fields. It uses varies colors for file owner, group, inode, links, permissions, blocks, size, date modified information etc., Overall this will help us to identify file permission and other attributes easily.

exa’s options are similar, but not exactly the same, as ls. 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.

What’s Rust : Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

Install prerequisites for Exa

Make sure following prerequisites should be installed on your system in order to run exa without any error. Run the following command and follow the instruction to install Rust.

$ curl https://sh.rustup.rs -sSf | sh

Install required development tools & libraries on Debian based systems using apt-get command or apt command

$ sudo apt install libgit2-24 libgit2-dev cmake git libhttp-parser-dev

Install required development tools & libraries on Ubuntu based systems using apt-get command or apt command

$ sudo apt install libgit2-24 libgit2-dev cmake git libhttp-parser2.1

Install required development tools & libraries on RHEL/CentOS systems using YUM command

$ sudo yum install libgit2 cmake git http-parser

Install required development tools & libraries on Fedora systems using dnf command

$ sudo dnf install libgit2 cmake http-parser-devel

How to Install Exa using source code

Install required above development tools and build the latest development version from source. Clone latest version from github repository.

$ git clone https://github.com/ogham/exa.git && cd exa

Run make install in the new directory to compile and install exa into /usr/local/bin.

$ make install

How to Install Exa using binary method

The easiest way to install exa, is to download a binary file and place it under /usr/local/bin. Make sure you should have installed http-parser & rust on your system.

$ 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/exa

For Arch Linux based systems, its available in AUR repository so use either Yaourt or Packer to install it.

$ yaourt -S exa-git
$ packer -S exa-git

How to Use Exa in Linux

Let’s see few examples to understand exa. Simply type the exa command to get output.

$ exa

To get long listing with exa command.

$ exa -l

Display the output like as table with exa command.

$ exa -bghHliS

To know more about exa command navigate to man page.

$ exa --help

If you feel difficult to use exa, simply add following alias on your .bashrc file.

$ echo "alias ls=exa" >> ~/.bashrc
$ source ~/.bashrc

Now you can access exa command features within ls command. See the following example.

$ ls
$ ls -l
$ ls -bghHliS

You may also like...