This is merely just a vocabulary question, but which keeps turning around in my head.It comes from a practice exam from a LPIC preparation book. The correct answer according to the book is that ~/Documents is a relative directory because it is relative to the home directory.However, this book contains an honourable ratio of typos and mistakes so I cannot take for granted everything which is written there. Here I do not agree because for me ~ acts as a variable expanded by the shell into either the content of the $HOME variable or the current user home directory path (cf. man bash), so the actual path is /home/myuser/Documents which is indeed an absolute directory.Even Wikipedia, for once, seems of no help to me on this topic (even if it seems to confirm that the book is wrong on this one):An absolute or full path points to the same location in a file system  regardless of the current working directory. To do that, it must  contain the root directory.By contrast, a relative path starts from some given working directory,  avoiding the need to provide the full absolute path.Here again, I do not agree: according to this definition, the path /opt/kde3/bin/../lib which does not depends of the current working directory should be an absolute one, however my current understanding of this matches the book's author making this path a relative one.A quick web-search is just adding to my frustration, according to Webster Dictionary:absolute path - A path relative to the root directory. Its first character must be the pathname separator.So $HOME/Documents, or even just $HOME would not be considered absolute directories? Or does this definition implies variable expansion? What about the shell's ~ character? Is there any reliable definition of relative vs. absolute directory I can find somewhere and am I wrong all of the way?
Is `~/Documents` a relative or an absolute path?
shell;filenames
If the author was trying to catch you out by talking about that literal string (without shell expansion) as a path, then it's a relative path (mkdir -p './~/Documents').  Otherwise:It's an absolute path, because resolving it doesn't depend on the process's current working directory.  Relative path always means relative to the process's working directory.  Or in the case of symlink targets, relative to the location of the symlink.  (gcc -> gcc-5.2 vs. gcc -> /usr/bin/gcc-5.2).  This matters for NFS-mounts and other cases where you can get to the same symlink via different absolute paths.  e.g./net/tesla/home/peter/foo -> bar  # always works from other machines/net/tesla/home/peter/foo -> /home/peter/bar  # references my home dir on the local machine, not tesla.Debian will sometimes install symlinks to ../../doc/whatever/whatever, instead of an absolute symlink target, so it works when NFS mounted somewhere else, or when looking at a chroot without chroot(8)ing into it.Every Unix process has its own cwd.  The pwd command exists just to print it.see:  http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.htmlfor more about changing directories with POSIX system calls.As everyone else has said, ~ is expanded by the shell before the path is used for anything.  Using ~/bin/myprog in a shell script will make it work differently for different users.  The difference between ~/bin/foo and /home/peter/bin/foo is that one of them has hard-coded the location, while the other has parameterized it.  It's an error (IMO) to call the ~ version a relative path.Talking about things being relative to an environment variable is just confusing.  It's bad practice to use different English-language meanings of terms that have specific technical meanings in the context you're using them in.On a broken system, with HOME=a/relative/path, ~/foo would expand to a relative path.  This would not be a usable setup at all.