Why I use exa instead of ls on Linux

Exa is a modern-day replacement for the Linux ls command.
Register or Login to like
bash logo on green background

Opensource.com

We live in a busy world and can save time and effort by using the ls command when we need to look for files and data. But without a lot of tweaking, the default ls output isn't quite soothing to the eyes. Why spend your time squinting at black and white text when you have an alternative in exa?

Exa is a modern-day replacement for the regular ls command, and it makes life easier. The tool is written in Rust, which is known for its parallelism and safety.

Install exa

To install exa, run:

$ dnf install exa

Explore exa's features

Exa improves upon the ls file list with more features and better defaults. It uses colors to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it's small, fast, and has just a single binary.

Track files

You can use exa to track a new file added in a given Git repo.

Tree structure

This is exa's basic tree structure. The level determines the depth of the listing; this is set to two. If you want to list more subdirectories and files, increase the level's value.

This tree includes a lot of metadata about each file.

Color schemes

By default, exa segregates different file types according to built-in color schemes. It not only color-codes files and directories, but also Cargo.toml, CMakeLists.txt, Gruntfile.coffee, Gruntfile.js, Makefile, and many other file types.

Extended file attributes

When you're exploring xattrs (extended file attributes) in exa, --extended will show up in all the xattrs.

Exa understands symlinks and also points out the actual file.

Recurse

When you want to loop listings for all directories under the current directory, exa brings in recurse.

Conclusion

I believe exa is one of the easiest, most adaptable tools. It helps me track a lot of Git and Maven files. Its color-coding makes it easier for me to search through multiple subdirectories, and it helps me to understand the current xattrs.

Have you replaced ls with exa? Please share your feedback in the comments.

What to read next
Sudeshna is from Kolkata and currently working for the Red Hat Middleware team in Pune, India. She loves to explore different open source projects and programs. She started contributing to Open Source a couple of years back as an Hacktober Participant since then she has been an avid blogger at Dzone on Python and Data Science. She enjoys her free time stargazing and loves continental cuisine. She is an RHCSA and is working her way to RHCA.
Sudeshna is from Kolkata and currently working for the Red Hat Middleware team in Pune, India. She loves to explore different open source projects and programs. She started contributing to Open Source a couple of years back as an Hacktober Participant since then she has been an avid blogger at Dzone on Python and Data Science. She enjoys her free time stargazing and loves continental cuisine.

16 Comments

exa output itself hard to read--a slightly brighter yellow in some column of 'exa -l' is just about invisible on the pale yellow background I use in konsole. Not only do I have no idea what data is shown in that column, controlling the colours is ridiculously complex.

In reply to by Greg Pittman

I would love to use this. I was just about to alias ls/ll to exa until I realized this tool does not properly support SELiunux file context and simple output you get with an "ls -Z". Unfortunately that is a deal breaker for me. :(

I love exa. It is a lot prettier than ls and the git and tree functionality is great. I have written this wrapper script so that the appearance and switches are nearly identical to ls, so you don't have to memorise any new ones.

https://gist.github.com/eggbean/74db77c4f6404dd1f975bd6f048b86f8

exa is interesting to see, but I am not sure if it really is bringing any additional value to my workflow; everything that it can do is already there, and it basically combines multiple tools into one and thus not following the unix philosophy. This is not necessarily bad, but in this case I favor to use the default tools.

There is also already in bash a command tree, which does something similar.
Look at 'man tree' to see its options, which are quite extensive.

Seems like a cool programming project but overall why change something that works well already... and also break the UNIX philosophy.

Amazing tool. I never knew I didn't like `ls` but wow exa is so much better!

On my Ubuntu exa is 6 times larger then ls (903k vs. 146k). Can you explain why? Isn't that too much?

Hi Sudeshna, I still feel its not the colors that give a relief to the eye. What matters most is using ```ls -lrt``` to have a similar view and not installing a third party tool. which as kakadu pointed out is around 6 times larger than ls. Anyways it was a great article

I don't think exa can or will displace ls, but it seems to be a nice text mode addition to have. I personally like ranger and especially vifm for a similar purpose (browsing text mode but visually). Thanks for the article :)

It took me a while to find out that this package is not in the RHEL or CentOS repos. Only Fedora.

I've got used to https://github.com/supercrabtree/k after using it for years - it's a bit slower but gives me extra things that aren't features of exa

I don't understand... So, use exa to do all the same things I can do with ls?

Think the only thing I can't do with ls is that tree output, but I use this which writes to a file if I want a tree output of all files in a directory.

alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' > $tree.txt"

idk... don't see the need to use exa unless it can do some really cool stuff that I can't do otherwise without it.

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.