Is there a name for the text that shows up at the front of each command in a CLI?

Solution 1:

It’s called “the prompt.”

In Llinux, you could be more specific and say πthe bash prompt” in the case of the bash shell, or for the KSH shell, The KSH (korn shell) prompt etc…

In Windows you can change the prompt with the PROMPT command.

In Windows, you could be more specific and say “the C prompt”, and the prompt in Windows is most famously C:\> or C:\something...> so you can see how it gets that name.

A techie might have frustratingly said to a user on the phone “Do you get the C prompt?” While saying it as C prompt, some write it as The C:\ prompt or The C: prompt. One wouldn’t call it that when it was A: or D: (which you get when you boot DOS off floppy or cd drive, or you change to one those drives from the command prompt) and nobody talks of the “A prompt” or the “D prompt,’ only the famous one, the “C prompt.”

Solution 2:

Hopefully this further info is useful to you (or someone else).... You can view/set "the prompt" via the PS1 environment variable.

To see what the current prompt is set to...

$ echo $PS1

To set the current prompt to something else...

$ export PS1="\n\u@\h:\w\r\n$ "    (for example...)

To see the many parameters that can be used to customize a prompt...

$ man bash        (then type  /^PROMPTING  and hit Enter)

Solution 3:

It is also notable in Linux:

  • The prompt ending in $ denotes a normal shell.

  • The prompt ending in # denotes a root shell (careful!)