0

In windows, I just have to type title mytitle to change the title of the terminal.

c:\title mytitle

How to do it in ubuntu?

2 Answers2

0

One option:

gnome-terminal --title="my_title"

For this to work, you probably have to comment this fragment in ~/.bashrc

case "$TERM" in
xterm*|rxvt*)
    # Comment this
    #PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

You may also try issuing command

echo -ne "\033]0;my_title\007"

See also this.

0

this is simple enough


set-title(){
  ORIG=$PS1
  TITLE="\e]2;$@\a"
  PS1=${ORIG}${TITLE}
}

reference https://blog.programster.org/ubuntu-16-04-set-terminal-title

  • You should add that answer to the duplicate candidate. In any respect you still have to add the function to ~/.bashrc like all the other answers posted in the duplicate candidate. – WinEunuuchs2Unix May 26 '21 at 01:27