ParentDirectory
ParentDirectory[] gives the parent of the current working directory.
ParentDirectory["dir"]gives the parent of the directory dir.ParentDirectory["dir", n]gives the directory n levels up from dir.
Examples
ParentDirectory[]ParentDirectory["/path/to/some/dir", 2]Please visit the official Wolfram Language Reference for more details.