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