Wibbly Stuff

Customize the Linux Terminal

The Linux Terminal is powerful, but sometimes can be dull and boring. Here are some of my customizations that make the Terminal a little more attractive. All of these can be done by editing the .bashrc file in the Home folder. All these are not for Linux Mint by the way, as Linux Mint already has these customizations.

Add Some Color:

Wanna display the current directory and your username in bash? But with some colors? Then just add the following in the .bashrc

# Colors
PS1='\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\W\[\033[00m\]\[\e[1;32m\]\$\[\e[m\] '

if you want to show those in red for root, you can add,
# Colors
if [ $USER = root ]; then
PS1='\[\033[1;31m\][\u@\h \W]\$\[\033[0m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\W\[\033[00m\]\[\033[1;32m\]\$\[\033[m\] '
fi
Display a Fortune:

You can display random quotes in bash. First install fortune-mod.

For Ubuntu,
sudo apt-get install fortune-mod

For Fedora
su -
yum install fortune-mod

Now add the following to the .bashrc

fortune -s


Here is my Terminal(Konsole) in KDE.

If you want to display animals as above, first install cowsay,

For Ubuntu,
sudo apt-get install cowsay

For Fedora
su -
yum install cowsay

Then add,

fortune -s | cowsay -n

In stead of

fortune -s

To randomize cows, you can replace it with

fortune | cowsay -f \$(ls /usr/share/cowsay | shuf -n1)

You can refer this wiki for further details.