Tuesday, February 25, 2020

By default linux server shell color are boring. Basically just using 1 color (white).  While white is okay for simple operations like installing packages, removing logs, etc...  White certainly does not help when listing directory contents.

Colorizing the content of directory really helps because it can distinguish different information using different colors, such as file vs directory. Even better showing full permission files and many more advantages.

Here is a simple instruction of how you can easily colorize your LS directory listing output for Linux (works with debian, ubuntu, centos, redhat, etc...)


In Linux edit /home/(user)/.bashrc

example:
nano /home/admin/.bashrc

Add or make sure the following lines are added:

export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'


If you like this article and like your new colorized directory listing, you may want to read my other article about using EXA (a modern replacement for LS - which uses colorized listing by default).

Saturday, February 22, 2020

Install EXA in Ubuntu - replacement for ls (directory listing)

EXA is a modern replacement for the ls (list directory content) command.

There are many benefits for using EXA (many more features you can find on EXA website)
  • Automatic default colors
  • Recursive directory listing
  • Tree view listing
  • GIT support
  • many more see EXA website

sudo apt-get install libhttp-parser2.1
cd /usr/local/src
wget https://github.com/ogham/exa/releases/download/v0.9.0/exa-linux-x86_64-0.9.0.zip
unzip exa-linux-x86_64-0.9.0.zip
sudo mv exa-linux-x86_64 /usr/local/bin/exa

If you would like to automatically replace ls with exa so that everytime you time ls it will use EXA instead, add the following lines to your .bashrc file.

Add to your .bashrc

nano ~/.bashrc

alias ls="exa"
alias ll="exa -l"