I am aware of this question: Relative paths for portable notebooks in Mathematica

In the answer it is said that


is the equivalent to

cd ..

Which does not work for me. Directory[] does not take an argument. So what is the correct solution to go to your parent directory?

  • $\begingroup$ You missed the part of an answer, it should be: SetDirectory[NotebookDirectory[]]. $\endgroup$
    – m0nhawk
    Sep 20, 2015 at 9:26
  • $\begingroup$ But this does change to the directory where my notebook lies. But I want to go to the one above. $\endgroup$
    – mcocdawc
    Sep 20, 2015 at 9:31

1 Answer 1


If you want to have the parent directory of the current directory, use


The parent directory of your notebook can be found using:


If you want to set the parent of the notebook directory as the current directory use:


Note that if you use NotebookDirectory[] your notebook has to be saved first (i.e., it doesn't work on an untitled notebook that you just created using File > New)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.