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\] '
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: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
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
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
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.