Introduction
One question I get asked most frequently by anyone who sees me using terminal is
How do I get colors in
ls
?
Simple answers is you can’t. The command I am using is not ls at all. It is exa
.ls
is one of the most used command. There is nothing wrong with ls, it is very plain though.
Why switch?
Below are few of the reasons you might consider switching
Color
Commandline is mostly black-white. Adding a little color won’t hurt. Be aware, getting used to it can be frustrataing to use other people’s terminal.
Informative
Apart from being colorful, makes it easier to read the output, especially the permissions section
Performance
There is on-going trend where GNU core utils are being re-written/implemented in rust . This is mostly done for performance gains. In this case, you will hardly notice any difference.
Icons
You will get nice icon for folders and files depending on the filetype. For icons to show up either Nerd font or Powerline fonts is required.
Looks cool
Leaving everything aside, this just look cool, increases your coolness factor by x among your peers. Just say’in !
Alternatives list
- exa
A modern replacement for ‘ls’.
github
- lsd
The next gen ls command
github
- nat
ls
alternative with useful info and a splash of color art
github
Having tried all, I have settled on exa
.
Installation & Set up
Installation can be done using either rust package manager cargo
or system package manager
|
|
|
|
|
|
|
|
|
|
Lets compare the output of ls
and exa
.
|
|
|
|
Configure
It is not practical to type exa with these flags everytime. It can be fixed with a simple alias
|
|
|
|
Screenshots
Conclusion
For someone who spends most of the time in terminal. Switching anyone of the above metioned alternative can provide a productivity boast and make life a little more colourful.