Friday, August 5, 2011

Change your Terminal look


I have described you about some UNIX tools in my previous posts. Now take a look at a interesting experiment on your terminal.

This experiment is regarding how to run a command automatically every time you open a new terminal. If you bored with the regular terminal, then you can experiment on it.
Open your terminal first. Then type, 

gedit ~/.bashrc

Now the gediter will be opened and a file named .bashrc is opened. It is a hidden file. That is why its name starts with a dot. Now copy the following code into that file.

if [ $(id -u) -eq 1 ];
then # you are root
  PS1='\[\e[1;31m\][\u@\h \W]\$\[\e[0m\] '
else # normal
  ls
  PS1='\[\033[33;22m\]\u @ \w\[\033[04;36m\]\t $ \[\033[01;00m\]♡'
fi

Now close the geditor by saving the file. And also close the terminal. Now open a new terminal. You will see a brand new terminal now!!!

You can give any commands in the place of ls and can change the symbols and colors also.
Examine the code yourself and try to make changes and build a your own terminal look.
Here is the screenshot of my Terminal.


Thanks 

AJAY

No comments:

Post a Comment

Comments with advertisement links will not be published. Thank you.