Thursday, December 29, 2011

Beautify the Linux Terminal

Want to have your terminal word can you change what you like?

There is a way, first open a terminal and then type the command:
sudo apt-get install figlet

edit file  .bashrc
# root@BackTrick$ gedit .bashrc

PS1='\[\e[1m\][\u@\h][\W]\n\[\e[1m\][\$]\[\e[0m\] '
Columns=$(tput cols)
Startpoint=$(($Columns-22))
Color1=`tput setab 2`
Color2=`tput setab 5`
Normal=`tput sgr0`
Time=`date +%r`
Date=`date +"%d-%m-%Y"`
tput sc
tput cup 0 $Startpoint
echo -n $Color1$Time $Color2$Date$Normal
figlet "BackTrick"


script :
Columns=$(tput cols)
Startpoint=$(($Columns-22))
Color1=`tput setab 2`
Color2=`tput setab 5`
Normal=`tput sgr0`
Time=`date +%r`
Date=`date +"%d-%m-%Y"`
tput sc
tput cup 0 $Startpoint
echo -n $Color1$Time $Color2$Date$Normal
adalah :
11:24:16 PM 29-12-2010

You can change color according to your desired color .. by replacing the existing code in this lineColor1=`tput setab 2`
Color2=`tput setab 5`

0 black
1 red
2 green
3 yellow
4 blue
5 magenta
6 cyan
7 white

they are list code tput color .

0 comments:

Post a Comment