Ubuntu – the name of the text to the left of a command (as typed in a terminal) called

bashcommand line

I was wondering if there is any name to the leftmost text (after which we type the command) in a Linux terminal.

Like

ubuntu@Ubuntu:~$ 

Do we have a name for this?

Best Answer

It's called the primary prompt string, set by the shell according to the PS1 environment variable. This is usually set per user basis, for interactive shells only, (usually) defined in ~/.bashrc with the default as \s-\v\$.

On my system:

$ echo "$PS1"
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\W\$ 

and expanded to:

username@hostname:pwd$ 

Check the PROMPTING section of man bash to see what each token does.