15 November 2012

Bashrc, Bash_profile & how to change shell color in linux

There is a difference between bashrc and bash_profile in different distributions of Linux. You might need to specifically find out about the distribution you are working with. Generally difference between them are as follow:

According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells. (more)

There are several things you can do with your bash_profile and bashrc. Let us examine some of them. Let's say you want to change how the command prompt looks, you can each time set it to what you want, or better you can set it in your bash_profile and let it be. You can set something like this:

export PS1="\e[0;31m[\u@\h \W]\$ \e[m"

for a full range of what you can do with your PS1 (prompt in Linux/Unix) you can search online or look at BASH Shell change the color of my shell prompt under Linux or UNIX or How to: Change / Setup bash custom prompt (PS1)
.

No comments:

Post a Comment