Commands

Exa – A Modern Replacement for “ls Command”

exa is a modern replacement for the command-line program ls that ships with Unix and Linux operating systems, with more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary. By deliberately making some decisions differently, exa attempts to be a more featureful, more user-friendly version of ls. In this article, we look at Exa – a modern replacement for ls command-line tool.

Prerequisites for installing Exa

Before you proceed in getting Exa on your system, ensure that you have the following requirements:

  • Rust Programming language ( Version 1.17.0)
  • libgit2
  • cmake

Installing Exa in Linux Systems

First, download and install the official compiler for the Rust programming language as shown:

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

Thereafter, you will be presented with a list of options as shown. Select the first option which is going to add the bin directory for cargo to your $PATH.

install rust
Install rust

The installer will continue downloading all the necessary components and updates and upon successful installation. Next up, download the Exa zip file from the Official site as shown.

$ wget https://github.com/ogham/exa/releases/download/v0.9.0/exa-linux-x86_64-0.9.0.zip

Once downloaded, unzip the file to retrieve exa-linux-x86_64 the binary file which we are going to place it in the /usr/local/bin directory.

$ unzip exa-linux-x86_64-0.9.0.zip

Finally, move the binary file to the bin directory so that it can be accessed on the CLI.

$ sudo mv exa-linux-x86_64  /usr/local/bin/exa

That is it!

How to Use Exa in Linux Systems

Here, we will look at a few usage examples of exa command:

Exa example output
Exa example output

To get the most out of the command, append the -l flag as shown. This will display colorized output as shown.

$exa -l
Exa example output
Exa example output

The command below displays additional information such as inodes, file/directory size, Blocks, User and Group to mention a few.

$ exa -bghHliS
Exa additional information
Exa additional information

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. To know more about exa command navigate to man page.

$ exa --help

That’s it all! If you have any questions or feedback, feel free to leave a comment.

Related Articles

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button