What does ~$ stand for? For example:


So far I know that the $ sign is a symbol for a regular user. If I'm not mistaken root have # at the end.

I also found a lot of commands in the forums that begin with $:

$ sudo apt-get update 

So for what does $ actually stand for?

EDIT (28.01.2014) :

Today I came across this video that totally answers my question from 8 months ago and decided to share it here :)

BASH Basics - https://www.youtube.com/watch?v=x73WTEltyHU

4 Answers 4


The ~ and $ are elements of the command line prompt. This indicates that your computer (or more exactly, I guess, the shell you are running) is waiting for user input. It is prompting you to input a command.

The $ is merely a separator or divider. It separates the command prompt from the command which follows it. When people write such things as $ sudo apt-get update (your example), they are simply telling you that the command, in this case sudo apt-get update, needs to be entered at a command prompt. Strictly speaking, perhaps, the $ is redundant in this context.

Other separators may be used in other situations. For example, # is used for a root shell.

The ~ (called 'tilde') is shorthand for your home directory. When it appears in a command prompt, e.g., user@hostame:~$, it indicates that the current working directory is your home directory. Thus if you run the list command, ls, without specifying any particular directory, it will list the contents of your home directory.

(By the way, $HOME, is not a command, as you suggest, but rather an environment variable. It determines the location of your home directory. You can see its value by running $ echo $HOME.)

  • 10
    @FEarBG I think this answer fails in one small aspect: the prompt is completely customizable and is just a decoration; you could decide to have an empty prompt, or use whatever symbols you like in it(e.g. on my computer I have replaced $ with ` ̃∴` as prompt symbol). You can change your prompt setting the PS1 environment variable to your liking.
    – Bakuriu
    Commented Jun 4, 2013 at 20:03
  • @Bakuriu Assuming bash, of course. Other shells MAY be different.
    – user
    Commented Jun 5, 2013 at 8:44
  • 1
    "Strictly speaking, perhaps, the $ is redundant in this context." - Yes, that is why we generally prefer to avoid the $ if there's no need for it (which there is for log copies or example outputs, for instance).
    – user98085
    Commented Jun 5, 2013 at 16:46

Traditionally, a shell prompt either ends with $, % or #. If it ends with $, this indicates a shell that's compatible with the Bourne shell (such as a POSIX shell, or a Korn shell, or Bash). If it ends with %, this indicates a C shell (csh or tcsh). If it ends with #, this indicates that the shell is running as the system's superuser account (root).

Source: here

  • on some (old, usually) systems, you have "#" even as a regular user (maybe to keep you on your toe ^^)... ie, some older shells don't change the symbol if you're root -vs- regular user. Commented Jun 5, 2013 at 14:48
  • Other possible source
    – lgarzo
    Commented Jun 5, 2013 at 16:55
  • ~ stands for your home directory.
  • $ it's a separator for your system, it comes from the command \$ from the man page.

So if you find a command beginning with $ it just says that nothing should be added before that.


user is the username your are logged in with.
@ is just to say here is a link.
ubuntu is the name of the system you are logged in as.
:~ says that you are in the user home directory now.
$ comes from the \$ escape sequence in the $PS1. man page.

But this can all be changed by reading in the man page. Thank you @demure for the help.

  • 2
    To be specific, it is the \$ portion of the $PS1, which is designed to show $ if not root (otherwise it will be #) man page exert
    – demure
    Commented Jun 4, 2013 at 16:17
  • @denure updated my answer, if you feel you can improve it please do so.
    – Alvar
    Commented Jun 4, 2013 at 20:26

The $ sign it the end of the prompt in terminal when you add a command like the one you showed, do not type in the $ else it will not work.

So $ sudo apt-get update

would be typed in as:

sudo apt-get update 

Hope that helps.


The ~ stands for your Home folder so name@pc_name:~/Desktop$ would show that you are in the Home>Desktop folder.

  • 3
    Perhaps to show that you should enter the command at the prompt.
    – Simon
    Commented Jun 4, 2013 at 16:19
  • 4
    And also to distinguish between a command run by a normal user (at the $ prompt) vs. root (the # prompt).
    – coneslayer
    Commented Jun 4, 2013 at 17:33
  • @FEarBG: It's an arbitrary convention, unrelated (as far as I know) to the use of $ to denote a variable name. There are only so many printable characters available on a keyboard. DOS and Windows use > in prompts, Unix usually uses $ or %. It tells you "this is a prompt" without wasting space on your screen (or, in the old days, ink and paper). Commented Jun 4, 2013 at 20:43
  • And of course, in DOS and Windows environment variables use %. As you say, it's largely arbitrary; there pretty much needs to be something, but it doesn't need to be the same everywhere (although it would be kind of nice if it was).
    – user
    Commented Jun 5, 2013 at 8:47

You must log in to answer this question.

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