Intellij: How to copy/paste a file in order to duplicate it?

As for a keyboard only solution to duplicate a file in IntelliJ:

On Linux:

Press Alt+Home to activate the navigation bar, then either press F5, or press Ctrl+C to copy the file and then press Ctrl+V to paste it, a dialog will appear to name your new file.

On Mac:

Press Cmd+Up to activate the navigation bar, then either press F5, or press Cmd+C to copy the file and then press Cmd+V to paste it, a dialog will appear to name your new file.


⌥ + drag

  • Mac
    Press Option key and drag the original file.
  • PC
    Press Alt key and drag the original file.

You will be prompted for a new name.

enter image description here

Works for classes too:

enter image description here


F5 will duplicate selected file prompting you to enter a name for the new file.