ParentDirectory

ParentDirectory[]

gives the parent of the current working directory.

ParentDirectory["dir"]

gives the parent of the directory dir.

Details

Examples

open allclose all

Basic Examples  (1)

Get the parent directory of the current working directory:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Equivalent form:

In[3]:=
Click for copyable input
Out[3]=

Scope  (1)

See Also

Directory  $HomeDirectory  DirectoryName

Tutorials

Introduced in 1991
(2.0)
| Updated in 2016
(11.0)