18

For example, in Ubuntu when I start up a terminal, it says:

username@computer:~$ 

And in Windows:

C:\Users\Username>

Is there a formal way to refer to that text?

3 Answers 3

30

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.”

7
  • Thank you! "Prompt" was the word I was looking for. I'll mark as accepted as soon as the timeout is up. Dec 14, 2012 at 23:22
  • 2
    Command Line Interface leaves the little chunk of text called the Command Prompt hanging out there looking lonely just waiting for you to give it a Command so it can serve you well. Dec 15, 2012 at 4:29
  • @FiascoLabs though the term "command prompt" tends to refer to the windows program often(which almost can't be without a prompt though perhaps one could say it is without a prompt if it is busy doing something e.g. a long dir),and it doesn't necessarily refer specifically to the prompt within the command prompt. It might refer only to the little text when used to say "Type this at the command prompt"(though maybe both even there). And it must refer to both when one says "Do you see the command prompt". The term CLI is a very general term that contrasts with its opposite term GUI
    – barlop
    Dec 15, 2012 at 9:50
  • 1
    Heh, I was introduced to the term command prompt through using Unix. So it's not a Windows specific term and the naming of the Windows name for the console window came long after the usage came into existence and command prompt was used during a time when GUI's were a sparkle in their mommy's eye. Thanks for the laugh... Dec 15, 2012 at 17:43
  • @FiascoLabs in my comment where I wrote " though the term "command prompt" I meant "in windows though, the term command prompt"(hence I mentioned DIR in that comment) though granted I could've been clearer in that comment. In windows the term command prompt often refers to the program. And I gave examples where it's hard to see where it'd refer to just the prompt. What you said is not really the case in windows, though you spoke generally.
    – barlop
    Dec 15, 2012 at 21:37
8

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)
1
7

It is also notable in Linux:

  • The prompt ending in $ denotes a normal shell.

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

2
  • 8
    Of course that’s just a convention; you can set the prompt to whatever you want, whether or not you’re privileged. (In school, we used to set our prompts to “#” in the hopes that a sysadmin would walk by, see it, and freak out.) More broadly stated, the convention is that a prompt ending “#” denotes a privileged environment, and anything else denotes an unprivileged one. (Some shells have used “%” or even “>” as their non-privileged default.) Also, some non-Unix machine follow the “#” = privilege convention. Dec 15, 2012 at 1:11
  • Ah - very cool and useful to know. Thanks! Dec 18, 2012 at 0:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .