Why Rebuilding ls is a Good Thing

You step into a crowded room, maybe a convention center floor, or a wedding reception, or a meetup of tech professionals. Faces start to blur together. Voices crowd one another out.

You have just a few seconds to ask your brain some very basic questions, including, "Who's here?" Essentially, you're asking your brain the human equivalent of ls, which lists the files and folders in a given location. Your brain does some phenomenal computations and returns a bunch of facts about the people around you.

That's ls for you. It answers the question, but it's not always pretty, and it might not give you any sense as to what to do next.

If you could find a way to make that answer better, wouldn't you?

Ask the right question, make people mad

I recently stumbled across a relatively new tool called exa, which bills itself as a "modern replacement for ls," on Hacker News. As someone who runs Fedora on my primary machine, I'm always curious to discover new tools that might make some aspect of my daily use and administration better.

The post has a solid number of points (736 at the time of writing), but the number of comments surprised me—what about a simple terminal application warrants nearly 400 responses?

Scroll down a ways in the comments, or wade into one of the deeply-nested conversations, and you'll start to find little hints of the anger-twinged reaction to exa.

There were complaints about the binary's vast 3MB size:

exa is written in Rust, so it’s small

I suspected this would be total bullshit, and it is. Its small binary is a mere 3.4 megabytes. I wonder if I misinterpreted the "small" part.


And the use of colors, of course—or, for that matter, anything that's not white text on a black terminal background:

The last thing I want in terminal is colours.


Colors are good...too many colors is overwhelming.


Surprised no one has suggested replacing permissions display with emoticons.


Or, the name itself:

For a command that gets typed as often as 'ls', choosing 'exa', which is typed with one hand only, even worse, with a repeated finger, is kind of a poor choice.


And, finally, criticism about the way in which Exa was programmed (using Rust):

A multi-threaded program to list files. The times we are living in...


A replacement for what?

Why all the snarky responses, none of which provide much useful criticism for exa's developer? Unfortunately, it comes down to a single phrase, used on exa's website, and repeated in the Hacker News headline: "exa is a modern replacement for ls."

Clearly, much of the discontentment is due to a branding miscommunication, which caused exa to become the catalyst for a much larger discussion about the GNU coreutils. These tools are perceived by many to be infallible and perfect, if only for the reason that they've been around for so long.

The coreutils, which include other Unix must-haves like rm and chown, are excellent tools. They're extremely small, efficient, and excellent at their respective jobs, however small.

To believe that a single developer could jump into the conversation and build a better ls is, quite frankly, ridiculous.

But so is the idea that ls could never be improved upon.

The value of rebuilding

In the FAQ for exa, the author even states, rather plainly, that the program isn't intended to be a direct replacement for ls.

Is this a drop-in replacement for ls?

No — exa has, in my opinion, much saner defaults than ls, so while the available command-line options are similar, they are not exactly the same. Most of the common options will work consistently, though. For example, exa prints human-readable file sizes by default (when would you not want that?) so ls -h no longer applies.

Many Hacker News commenters seem to have skipped over that message, unfortunately. It's easier to believe an alternative narrative in which Benjamin, the developer, is claiming that he's made ls obsolete with two year's time and a few thousand lines of code.

The truth is that he's made some strict design choices that make exa more logical, readable, and failsafe ls—in his opinion. He's not claiming his ideas to be better (for the most part), and he's not claiming that ls is a failure of a utility.

_jal might be the exception to the rule when it comes to responses to exa. Just ahead of some thoughtful criticism of exa, _jal finds common ground:

It is great to scratch an itch and make something behave exactly as you want it to be - kudos.

Go forth and rebuild

Should we go out and build actual replacements for all of the GNU coreutils tomorrow? Absolutely not.

Should we start to think about ways to improve those tools, or come up with new ones that better match how we use computers today?

If we don't, what are we working toward?

Entire industries have sprouted up in the last few years based solely on improving upon a process we all know and hate. Why not think of ways that we could simplify

That's not to say that a replacement—or an alternative—to any GNU coreutil will ever make you a single penny. But if you're looking for a way to improve the way you develop or interact with your computers, there probably isn't a better place to start from the very bottom.

It's admirable, and it's interesting, and each of these projects, however battered by criticism, will help shape the next era in how we ask our computers these most simple of questions.