I can run shell commands from an open jupyterlab (or jupyternotebook) session with an exclamation mark preprended to the shell command, as follows:
!mkdir /new_folder
This, as well as other commands such as ls and pwd work, though if I try to change directory with cd, as shown below
!cd /path/to/mydir
this does not work and I have noticed that the current working directory will always be the one where my jupyter notebook (.ipynb) is saved.
It is also odd that if I do:
!cd /path/to/mydir && pwd
I will get /path/to/mydir printed out, though if, on the cell below I do
!pwd
I will get the current directory where my jupyternotebook is saved i.e. apparently I eventually cannot change the working directory with !cd in a jupyternotebook.
Does anyone know what the problem could be?