-1

Note: This is a self answered question.

My normal terminal looks like this:

───────────────────────────────────────────────────────────────────────────────────────────
rick@alien:~$ echo $$
13462
───────────────────────────────────────────────────────────────────────────────────────────
rick@alien:~$ echo $SECONDS
52832
───────────────────────────────────────────────────────────────────────────────────────────
rick@alien:~$ echo $(date)
Sat Aug 10 11:46:29 MDT 2019
───────────────────────────────────────────────────────────────────────────────────────────
rick@alien:~$ 

I would like an easy way to remove the long line and $USER@$HOSTNAME.

Manually editing PS1 (as many answers propose) is cumbersome changing it to:

\[\e]0;: \w\a\] \n${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
0

termprompt sample output

───────────────────────────────────────────────────────────────────────────────────────────
rick@alien:~$ termprompt

:~$ echo $$
13462

:~$ echo $SECONDS
53998

:~$ echo $(date)
Sat Aug 10 12:05:49 MDT 2019

:~$ 

termprompt function

Edit your ~/.bashrc file and and these lines:

function termprompt() {
    PS1="${PS1//\\u@\\h/$1}"
    PS1="${PS1//─}"           # Special circumstances
}
  • You can remove the line containing # Special circumstances or customize it.
  • With no parameter the user name and host name are simply removed.
  • Or you can customize the prompt termprompt "Enter Command" for example.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.