Terminal renaming method under linux

1. Insert the following content after vim.bashrc

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

2, title naming
title 192.168.1.2

Guess you like

Origin blog.csdn.net/sun172270102/article/details/111335317