After my last article covering the ls command and its options, I was thinking about the shelf life of some commands and the improvements that you would have expected to see over the years. This kicked off a memory in my brain from All Things Open (ATO) 209 where IBM’s Chris Waldon hosted a talk on Terminal Velocity: Moving fast in your shell. If that title sounds familiar, it's because he wrote an article based on this talk. Anyway, during the ATO presentation, he featured a tool called exa that's a replacement for ls and I was pretty impressed with it. It turns out that some commands have been improved upon via well-executed, modern replacements. The exa utility is one of them.

So, what is exa? 

exa, as I mentioned earlier, is an improvement on the classic ls command. At its heart, it serves to display listing information for all files and directories in your current working directory. It doesn’t sound all that exciting, does it? There is, however, more on offer here than you might initially think. 

ls vs exa

What improvements has exa made over ls? 

The design approach around exa is simple. More is better. If you browse the webpage, you’ll find that the creator put a lot of thought into why ls was so spartan. It makes a lot of sense. In the 1960s, computers were exponentially more limited by processing time for the input of commands and the output of results. The original command line suite of commands was built with this I/O bottleneck in mind. With today’s advancements in computing technology, most of us have supercomputers in our pockets that can handle these tasks with ease. So, of course, modern servers and desktops can handle whatever we throw at them in most circumstances.

exa runs the stat system call on every single file it encounters. It then takes the information gleaned from this call and color codes it by permission type, owner, size, and more. One of the first things you’ll notice when using exa is how colorful things are. If you're one of those weird people who prefer the drab black and white of a traditional terminal output, you can opt-out of the color usage if you want. For everyone out there who uses git repositories for change management, exa also displays the git status of files when applicable. As of this writing, only two git changes are currently tracked:

  • N - new file
  • M - an existing file

Installation and Aliasing

If these features look appealing to you, I recommend that you install exa and give it a try. Exa is packaged for a number of distributions. On Fedora, install the rust-exa package with sudo dnf install exaYou can also install in on Red Hat Enterprise Linux (RHEL), albeit manually, and it works on macOS as well. For detailed installation instructions, be sure to check out the official exa webpage

Once you have the program installed, you may want to alias it over your standard ls command. My alias looks something like this: 

exa alias to ls

I encourage you to give it a try.  You might enjoy the tool and, if nothing else, it might get you thinking of other improvements that we need as sysadmins.

Want to try out Red Hat Enterprise Linux? Download it now for free.


关于作者

Tyler is the Sr. Community Manager at Enable Sysadmin, a submarine veteran, and an all-round tech enthusiast! He was first introduced to Red Hat in 2012 by way of a Red Hat Enterprise Linux-based combat system inside the USS Georgia Missile Control Center. Now that he has surfaced, he lives with his wife and son near Raleigh, where he worked as a data storage engineer before finding his way to the Red Hat team. He has written numerous technical documents, from military procedures to knowledgebase articles and even some training curricula. In his free time, he blends a passion for hiking, climbing, and bushcraft with video games and computer building. He is loves to read and enjoy a scotch or bourbon. Find him on Twitter or on LinkedIn.

UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Virtualization icon

虚拟化

适用于您的本地或跨云工作负载的企业虚拟化的未来