The Linux ls Replacement That’s a Little Bit Extra
The ls command does its job well. But is there a better and more powerful utility for listing files and folders on Linux?
The Linux ls command is something most users use all the time, but they never seem to think it could be improved upon.
exa aims to replace this venerable command with a colorful appearance and new features. Will it replace ls for you? Let’s find out!
What Is exa?
exa is a file listing utility similar to the standard ls command supplied with Linux distributions. It’s an open-source program written by Benjamin Sago. It’s written in Rust and supports many modern Unix-like systems, including macOS, the BSDs, and of course, Linux.
exa is unique for its extra features, such as its appearance, the ability to list extended file attributes, its awareness of Git, and the ability to display directories in a tree format.
Installing exa on Linux
exa is available in the official repositories of several major Linux distros. You can install it on Debian and Ubuntu using APT:
sudo apt install exa
And on Arch Linux with:
sudo pacman -S exa
For the RHEL/Fedora/CentOS family:
sudo dnf install exa
Using exa to List Directories and Files
You can use exa just as you would use ls. The arguments are almost identical.
To list the files in your current working directory, just use the exa command by itself:
exa also takes path names as arguments:
To display more information, use the -l or –long option:
To display hidden files, use the -a or –all option.
To display subdirectories in a tree-like format, use the -T or –tree option.
To use exa to search subdirectories, you can use the -R or –recurse option, similar to ls:
The –grid option displays the output in a more compact fashion, which is useful for longer directory listings.
You can combine these arguments on the same command line. For example, to show a recursive tree with extended file attributes, including hidden files, starting from a certain directory, you’d type this command:
exa --tree --long --all --recurse /path/to/some/directory
You can also use the shorter form:
With the long to short options, this might be a lot to type. You should consider creating a Linux shell alias for the combinations you use frequently.
exa Is a Powerful Replacement for ls
With exa’s features, you may want to replace ls with it for listing files. You can list files more colorfully than with the standard ls utility. But when you find the files, you’ll want to do more. You’ll want to list their contents and examine them. Linux comes standard with tools to do these things.