Mac OS X change the terminal window title
The title of the Mac OS X terminal window can easily be changed. This can be useful when running a script or when using multiple terminal windows for different purposes to easily identify them when switching between applications and windows.
In the terminal window, from a bash prompt (the default shell) or in a bash shell script, use the following command to change the terminal window title to Tech-Recipes rules:
echo -n -e "\033]0;Tech-Recipes rules\007"
You can place (just about) any text in place of Tech-Recipes rules including the contents of a variable. For example:
name=`hostname`
echo -n -e "\033]0;$name\007"
This will change the title of the terminal to the hostname of the computer running the shell.






Add New Comment
Viewing 1 Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment