Here in this tutorial, we will find out how to install and use Exa on Ubuntu 20.04 or 22.04 linux. The commands given here can be used on other Debian or Ubuntu-based systems as well.
exa is a modern alternative to the ls command. exa is a revised terminal command (with more features) for listing files or folders. Colors are used for a clearer presentation by distinguishing file types and metadata. Symlinks, Git, and other attributes are also taken into account. It’s small, fast, and just one single binary.
- Steps to install and use exa on Ubuntu 22.04 or 20.04 LTS Linux
Steps to install and use exa on Ubuntu 22.04 or 20.04 LTS Linux
1. Perform a system update
The first thing we go with is running of system update command that will refresh the APT cache and install updates, if available.
sudo apt update && sudo apt upgrade
2. Install exa on Ubuntu 22.04 or 20.04
There is one problem that the Ubuntu 20.04 users will face, it is the exa package is not available to install directly using the APT package manager. However, since Ubuntu 20.10, the users can install it via APT and official repo which means Ubuntu 22.04 Focal fossa just needs to run a simple APT command.
For only Ubuntu 20.04 Users:
Go to the GitHub release page of the Exa tool and download the latest available file for Linux platfrom of this tool in zipped format.
Once the file is on your system, extract, and move it to
Switch to the Downloads directory if you have used the browser to download the file.
Now, extract and move the binary.
sudo apt install unzip
unzip exa-linux-x86_64-v*.zip -d exa
sudo mv exa/bin/exa /usr/local/bin/
For Ubuntu 22.04 Users:
Those who are using Ubuntu 22.04 LTS Jammy just need to run the given command to install exa on their system.
sudo apt install exa
3. How to use Exa
Compared to the traditional
exa has different presets. In particular, the file sizes are more readable by default, which was previously possible, for example – with exa, the option is omitted, furthermore, the outputs are automatically output in a grid. However, most of ls’s options will work consistently with exa.
Here are some examples:
To simply view files and folders
For getting Tree View with assigned permissions
exa -l --T
For just a tree view of files:
Each file name is displayed in a grid that fits into the current terminal window. The size of the columns of the grid depends on the file names displayed. This “grid view” is the default setting.
exa -l --grid
Headers for the columns and Git information
For a little more overview, you can display the corresponding headers for the individual columns of the long view.
exa -l --header
If you are in a Git repository, you can also display Git status information as well using:
exa --l --header --git
Recursion with limit
By default, exa displays everything when recursively displaying files and directories, if you do not need this information, you can limit the level of recursion. Change Level 2 with 3 or 4 as per your choice.
exa --recurse -l --level=2
Tree view with icons
It is possible to display Unicode icons for the most common file types, using the file extension and not the actual file type.
exa --icons -T
Display file with times
You can also display all file times (created, changed, last access), and use other options to design them accordingly so that you only get the times and the file name.
Here we are calling multiple options to display data accordingly and omitting the display of file permission and size information.
exa --long --header --changed --modified --created --accessed --no-permissions --no-filesize --sort created --reverse --time-style=long-iso
To display the total number of files:
You can also use the count and display how many fires are there in your current directory.
exa | wc -l
To know available Exa options
You can use the Help command: