Where are IntelliJ scratch files located?

I upgraded my IntelliJ IDEA to 14.1 and I found the scratch files.

If you create a scratch file, its path can be found in many different ways:

  1. On the title bar

  2. Right click on the tab > Copy Reference

    enter image description here

    You can paste it anywhere and it will look like:

    C:/Users/username/.IntelliJIdea14/config/scratches/scratch

  3. Right click on the tab > Rename File...

  4. Right click on the tab > Local History > Show History

  5. In .idea\workspace.xml it looks like:

    <file leaf-file-name="scratch" pinned="false" current-in-tab="false">
      <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch">
        <provider selected="true" editor-type-id="text-editor">
          <state vertical-scroll-proportion="0.0">
            <caret line="4" column="17" selection-start-line="4" selection-start-column="17" selection-end-line="4" selection-end-column="17" />
            <folding />
          </state>
        </provider>
      </entry>
    </file>
    

You can switch to project view and you'll be able to see them under "Scratches and consoles"


WebStorm project view


Starting with 14.1, Scratch Files are stored under .IntellijIdea14/config/scratches.

They are displayed either in Scratches and Consoles or on the Scratches tab (depends on the version you are using).

Current UI:

Scratches and Consoles

Earlier UI:

Scratches tab

IntelliJ IDEA Help - Scratch files