The UNIX prompt uses a
$ symbol to indicate that your input is expected.
I was wondering why this symbol was chosen—if there is a reason. Dollar just seems a little unexpected. A
> symbol would have been more suggestive in my opinion.
Let's explore a little:
Version 8 Unix is easy. There's still man pages available. Get to the sh man page and search for prompt. You'll get to a point where you read:
PS1 Primary prompt string, by default “$ ”.
PS2 Secondary prompt string, by default “> ”.
So let's see if that was the first.
Version 7 Unix man pages are still
available, and the
sh man page
gives the same description of prompts as
The culmination of your login efforts is a percent sign “%”. The percent sign means that UNIX is ready to accept commands from the terminal.
Aha! So version 6 didn't have it. Version 7 was the first! Released in 1979.
Happy? Hate to rain on your parade, but don't be :)
Problem is that version 6 was one inspiring Unix. Look at the variants here. Can it be that the $ sign as a command prompt was not started in Version 7, but instead in one of these variants and then the idea incorporated into 7?
At this point I got tired of hunting for operating systems documentation from a time when I was 6. This at least narrows it down considerably. We know Version 7 was the first Bell Labs release to show the $ sign as a command prompt. All we need to be sure is that none of those Version 6 variants introduced it. It makes sense for this change to have appeared in Version 7 though since that’s the release which introduced the Bourne shell, replacing the Thompson shell used in previous versions of Unix (and the Massey shell used in Programmer's Workbench Unix).
One last thought though:
While the idea of $ being a hint to the word shell or script is appealing and makes all sense, don't expect this to ever be officially confirmed. Unix development was shared by a rather large group of people with much bigger concerns in life than keeping track of how a symbol evolved. And some of these extraordinary programmers are not even among us anymore.
Most probably, the best you can hope to get from the question "What is the origin of the UNIX $ (dollar) prompt?" is the name of the first Unix shell introducing it.
Actually, the standard command-line prompt in Linux for a normal user account using Bourne, Bash or Korn shell is the dollar sign ($) while the root prompt is a hash mark (#). By contrast the traditional C shell prompt is a percent sign (%).
If I were to guess, the $ is reminiscent of the word $hell, which is probably why it was chosen.
Sadly, I can't answer the question, but I can give you a few pointers.
Attention: this may not be true, its just a wild guess:
I have a feeling that
$ is a psychological reminder.
We have to remember that back then, there wasn't a digital prompt, only a paper "teletype" (
tty). And probably the dollar was to say "you're wasting paper and money keeping this phone line up. just enter some commands already!!".
According to user 'dmr' on the first Unix system I ever used, which was "Unix System 2" on a PDP-11/70 in 1975, the $ prompt was meant to be suggestive of the letters "sh". I think it was already configurable by the variable PS1. The "System" designation was soon replaced with "Release" (which precedes "Version" by many years). According to the Unix User's Manual Release 3.0, June 1980, it was by that time PS1, which did default to '$ '. PS2 was and still is, of course, the secondary prompt used when a command is continued from one line to the next. Default for that is '> '.