title: What is the difference between ! and % in Jupyter notebooks?
body: <p>Both <code>!</code> and <code>%</code> allow you to run shell commands from a Jupyter notebook.</p>
  <ul>
  <li><p><code>%</code> is provided <a href="http://ipython.readthedocs.io/en/stable/interactive/magics.html" rel="noreferrer">by the IPython kernel</a> and allows you to run &quot;magic commands&quot;, many of which include well-known shell commands.</p>
  </li>
  <li><p><code>!</code>, provided by Jupyter, allows shell commands to be run within cells.</p>
  </li>
  </ul>
  <p>I haven't been able to find <a href="https://www.dataquest.io/blog/jupyter-notebook-tips-tricks-shortcuts/" rel="noreferrer">much</a> comparing the two, and for simple shell commands like <code>cd</code>, etc. The main difference I see is that <code>%</code> is interactive and will actually change your location in the shell <em>while in the notebook</em>.</p>
  <p>Are there other points or rules of contrast when thinking about which symbol to use for shell commands in a Jupyter notebook?</p>