What does ~$ stand for?

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


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


  • ~ 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@ubuntu:~$

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.


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.

Edit

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