Everyone uses ls
every day. It takes place six in my top ten used commands (calculated over the last 6803 commands):
2000 git
589 mvn
427 gcloud
392 ./ci/deploy
298 cd
237 ls
223 docker
193 sudo
140 curl
113 terraform
A command used so often should be a pleasure to use. But the output of ls
is rather dull.
Displaying the content of a folder with ls -alh
looks like this:
You get a lot of information, but it is hard to grasp:
if it’s a file or a directory
the access rights
the user and group (blurred out)
file size
modify date
file name
You can distinguish files and folders easily, but the rest is just white text. We could use some colors, and maybe icons?
A better solution.
exa gives you just that. The website says it’s a ‘modern replacement for ls’, and it surely is.
A modern replacement for
ls
.You list files hundreds of times a day. Why spend your time squinting at black and white text?
You can install exa
with your package manager:
sudo apt-get install exa
Look at the same folder with exa
.
You immediately spot some differences:
access rights are color coded
every column has its own color
icons show what kinds of files you have
special files (
README.md
) are highlighted
Already better. But there is more. You do not know what is inside the folders using ls
. With exa --tree --level 2
you can see the content of each folder:
There is much more to exa
. Check out all options at its website.
My favorite parameters are:
-l
which gives you the list view--icons
to get the icons--no-user
to hide information about the owner--group-directories-first
to show the directories first--time-style long-iso
to change the date format.
I added an alias to my .zshrc
(.bashrc
if you use bash) which overrides ll
:
alias ll='exa -l --icons --no-user --group-directories-first --time-style long-iso'
Using this, you get:
This enables me to grasp folder content much faster. I hope you can take advantage of this too.
Sources and links
I use Gnome Terminal with the Dracula Theme
my shell is
zsh
with oh-my-zsh