Opening Files from Command Line
You can open an arbitrary file, folder, or project for editing in IntelliJ IDEA from the command line.
- In the command line, run the following command:
<IntelliJ IDEA> path [--line <number>]
The command options are as follows:
| || |
The platform-specific IntelliJ IDEA launcher.
On macOS and Linux, it is recommended to use the command line launcher created during the IntelliJ IDEA installation, or create one manually by selecting on the IntelliJ IDEA main menu. Refer to Working with IntelliJ IDEA Features from Command Line for details.
On Windows, it is recommended to add the path to the IntelliJ IDEA executable to the
| || |
The path to the file or the folder to be opened.
| ||(optional) The line number, on which the caret should rest after opening the file.|
idea.exe path --line <number>
idea.exe C:\MyProject\scripts\numbers.js --line 3
idea path --line <number>
idea ~/MyProject/scripts/numbers.js --line 3