title: Fail to change directory (shell command) in jupyternotebook (or jupyterlab session)
body: <p>I can run shell commands from an open jupyterlab (or jupyternotebook) session with an exclamation mark preprended to the shell command, as follows:</p>
  
  <pre><code>!mkdir /new_folder
  </code></pre>
  
  <p>This, as well as other commands such as <code>ls</code> and <code>pwd</code> work, though if I try to <strong>change directory</strong> with <code>cd</code>, as shown below</p>
  
  <pre><code>!cd /path/to/mydir
  </code></pre>
  
  <p>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.</p>
  
  <p>It is also odd that if I do: </p>
  
  <pre><code>!cd /path/to/mydir &amp;&amp; pwd
  </code></pre>
  
  <p>I will get <code>/path/to/mydir</code> printed out, though if, on the cell below I do</p>
  
  <p><code>!pwd</code></p>
  
  <p>I will get the current directory where my jupyternotebook is saved i.e. apparently I eventually cannot change the working directory with <code>!cd</code> in a jupyternotebook.</p>
  
  <p>Does anyone know what the problem could be?</p>