Set terminal title in Ubuntu 16

Create a function in ~/.bashrc:

function set-title() {
if [[ -z “$ORIG” ]]; then
ORIG=$PS1
fi
TITLE=”\[\e]2;$*\a\]”
PS1=${ORIG}${TITLE}
}

Use below command to set the terminal title.

set-title name

Example :

  1. set-title Gurudath
  2. set-title Gurudath Workplace

Reference link: https://askubuntu.com/questions/774532/how-to-change-terminal-title-in-ubuntu-16-04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s