Every directory on a Unix system (and probably every other system too) contains at least two directory entries. These are . (current directory) and .. (parent directory). In the case of the root directory, these point to the same place, but with any other directory, they are different. You can see this for yourself using the stat, pwd and cd commands (on Linux): $ cd / $ stat . .. bin sbin ...
Check "The folder metaphor" section at Wikipedia. It states: There is a difference between a directory, which is a file system concept, and the graphical user interface metaphor that is used to represent it (a folder). For example, Microsoft Windows uses the concept of special folders to help present the contents of the computer to the user in a fairly consistent way that frees the user from ...
The . is the current directory, while .. signifies the parent directory. It makes things quicker at the command line as well so you don't need to type out full paths. example: go up 2 directories: cd ..\..\ or on a UNIX based system, to run executable binaries in the current directory: ./program A lot of UNIX scripts will also utilize . to represent the current directory, in order to scan for ...
│ │ ├─ anthony/ In this case, the user tommy owns his own directory under /home, but (for some reason) rents out space to other users, in this case mary and anthony. If mary, by mistake, where to execute git in her directory, but outside of her phone_app project, then old git would go up the directory tree to search a .git repository.
A word of warning - the highest rated answer might be susceptible to race conditions. You might want to perform os.stat instead, to see if the directory both exists and is a directory at the same moment.
The directory prefix is the directory where all other files and subdirectories will be saved to, i.e. the top of the retrieval tree. The default is ‘.’ (the current directory).
The "cd" command changes the directory, but not what drive you are working with. So when you go "cd d:\temp", you are changing the D drive's directory to temp, but staying in the C drive.
Path() is the current working directory, not the directory of the script. This only "works" in the few cases where the script actually is in the current working directory.