Changing the colors of your Linux console/shell is important when your scrolling through black text and you want your eyes to spot the shell line quickly.
If you want to change the colors of your Fedora Linux console line you have to change the PS1 Variable. Here is how I did it:
Step 1: Open up a console.
Step 2: Login as super user.
Step 3: Open up the file /home/yourhome/.bashrc
Step 4: Add this line anywhere after the invocation of /etc/bashrc (outside of the if block):
export PS1="[\e[0;31m\u\e[m@\e[0;34m\h \W \e[m]\$ "
Step 5: Save the file and restart the console.
Step 6: You should see red and blue showing for your shell.
If the codes above confuse you, don't worry, it seems to be a home-brew bash code system. \e[x;y means 'begin color' and \e[m means 'end color'. The escape codes are somewhat straight forward though.
Check out this website for more info on the escape codes:
http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
Wednesday, August 18, 2010
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment