After alias substitution is performed, each word is checked to see if it begins with an unquoted ~ (tilde). If it does, then the word up to the next / (slash) is checked to see if it matches a login name in the /etc/passwd file. If a match is found, the tilde and the matched login name are replaced by the login directory of the matched user. This is called a tilde substitution. If no match is found, the original text is left unchanged. A tilde by itself, or in front of a slash, is replaced by $HOME. A tilde followed by a plus sign or a minus sign is replaced by $PWD and $OLDPWD, respectively.
In addition, tilde substitution is attempted when the value of a "variable assignment" begins with a ~.
Example
The command
cat ~/.profile
allows you to edit the .profile file in your login directory from any location in your file tree.