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

2 thoughts on “Set terminal title in Ubuntu 16

Add yours

  1. Thank you, I’ve juѕt been seɑrching for information about thіs subject for a
    while and yours is the best I’ve discovered ѕo far. But, whɑt about the bottom line?

    Are you positive about tһe supply?

    Like

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: