How to change the title bar of the terminal screen

Hi,

How to change the value after the symbol '@' ?

[oracle@mac1~]$

i.e. @mac1

I want to change it to @prod2

Also need to change the same in the title bar on the top when we open a new terminal.

if you are connecting server through putty. You can go to "change settings" --> "Windows" --> "Behaviour"

I am directly accessing Linux machine. No putty.

It's possible to add special codes to your prompt that will cause the title bar of your X terminal (such as rxvt or aterm) to be dynamically updated. All you need to do is add the following sequence to your PS1 prompt:

"\e]2;titlebar\a"

Simply replace the substring "titlebar" with the text that you'd like to have appear in your xterm's title bar, and you're all set! You don't need to use static text; you can also insert bash escape sequences into your titlebar. Check out this example, which places the username, hostname, and current working directory in the titlebar, as well as defining a short, bright green prompt:

export PS1="\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\] "