4

I would like to change my jupyter notebook working directory, how should I proceed?

If it is possible, I also want to keep the current working directory.

Ravexina
  • 57,426

1 Answers1

5

You can change it using --notebook-dir=

jupyter notebook --notebook-dir=$HOME/Documents/MyProject

and like always use it without --notebook-dir= to get it run in current working directory:

jupyter notebook

If you always work on same directory then create an alias:

alias my_jupyter='jupyter notebook --notebook-dir=$HOME/Documents/MyProject'

Now when you run my_jupyter "Jupyter" will be run at $HOME/Documents/MyProject.

Ravexina
  • 57,426
  • Thank you very much. Just a stupid question: so I just run the line alias ... line directly, and I do not need to place this alias ... line into ~/.bashrc, is it right? – Sheng Bi Oct 04 '18 at 13:17
  • @ShengBi If you want it permanently which you want I guess, then you have to out it in .bashrc. – Ravexina Oct 04 '18 at 13:41