change the terminal title dynamically in X11

I was actually looking for this for quite sometime. Some years back in my bashrc was the proper setting for setting the terminal title when I did a cd, and I had completely forgotten how to do it. So today I searched quite a few commands the environment variables for doing the same and found it again.

Here it is (Just put this in your bashrc or bash_profile):

export PROMPT_COMMAND=\’echo -ne \”\\033]0;`pwd`\”; echo -ne \”\\007\”\’

[Edit] I just tried this with eterm and gnome-terminal and it works on both.

bash colors

Image via Wikipedia

For those of the terminal freaks, color is a bliss. But have you tried all the colors in the terminal. Today someone forwarded me a bash one liner for the same. Not sure where he got this from, anyway here is the one liner for you all:

for c in `seq 0 255`;do t=5;[[ $c -lt 108 ]]&&t=0;for i in `seq $t 5`;do echo -e \”e[0;48;$i;${c}m|| $i:$c `seq -s+0 $(($COLUMNS/2))|tr -d \'[0-9]\’`e[0m\”;done;done