Tilde(~) is used to denote this user's home directory whereas the slash(/) is used for separators for filesystem objects in both absolute paths and relative the paths. Also, it is used to represent the root directory.
On a side note:
~/ is used to denote the beginning of a path to the file or directory below the user's home directory.
~ contains the path to a current user home directory (it gets expanded to the $HOME env variable). If you run:
It will print this path. Slash character / is used by Linux (and other OSs) as the path separator. In Linux additionally, if you do:
It will bring you to a root directory (topmost directory of your filesystem)
Want to be a Linux expert? Come and join this linux course