# コマンドラインからファイルを開く

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

コマンドラインから CLion で任意のファイルまたはフォルダーを開き、必要に応じて開いた後にキャレットを配置する場所を指定します。

Windows:

CLion を実行するための実行可能ファイルは、 [インストールディレクトリ](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html)の  `bin`  にあります。 この実行ファイルをコマンドラインランチャーとして使用するには、 [コマンドラインインターフェース](working-with-the-ide-features-from-command-line.html)の説明に従って、システム  `PATH`  に追加してください。

構文
: ```PLAINTEXT
: clion64.exe [--line <number>] [--column <number>] <path>
:
: ```

サンプル例
: プロジェクトを開きます:
:
:
:
:
: ```SHELL
: clion64.exe C:\MyProject
:
: ```
:
:
:
: 特定のファイルを行番号 42 で開きます:
:
:
:
:
: ```SHELL
: clion64.exe --line 42 C:\MyProject\scripts\numbers.js
:
: ```

macOS:

デフォルトでは、CLion はコマンドラインランチャーを提供しません。 CLion のランチャースクリプトの作成について詳しくは、 [コマンドラインインターフェース](working-with-the-ide-features-from-command-line.html) を参照してください。

構文
: ```PLAINTEXT
: clion [--line <number>] [--column <number>] <path>
:
: ```

サンプル例
: プロジェクトを開きます:
:
:
:
:
: ```SHELL
: clion ~/MyProject
:
: ```
:
:
:
: 特定のファイルを行番号 42 で開きます:
:
:
:
:
: ```SHELL
: clion --line 42 ~/MyProject/scripts/numbers.js
:
: ```

Linux:

CLion を実行するためのスクリプトは、 [インストールディレクトリ](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html)の  `bin`  にあります。 このスクリプトをコマンドラインランチャーとして使用するには、 [コマンドラインインターフェース](working-with-the-ide-features-from-command-line.html)の説明に従って、システムの  `PATH`  に追加してください。

構文
: ```PLAINTEXT
: clion.sh [--line <number>] [--column <number>] <number> <path>
:
: ```

サンプル例
: プロジェクトを開きます:
:
:
:
:
: ```SHELL
: clion.sh ~/MyProject
:
: ```
:
:
:
: 特定のファイルを行番号 42 で開きます:
:
:
:
:
: ```SHELL
: clion.sh --line 42 ~/MyProject/scripts/numbers.js
:
: ```

ファイルへのパスを指定すると、そのファイルがすでに開いているプロジェクトに属している場合、またはプロジェクトを自動的に開くか作成するための特別なロジックがある場合 (たとえば Maven または Gradle ファイルの場合) を除き、CLion はそのファイルを [LightEdit モード](lightedit-mode.html) で開きます。 If you specify a directory with an existing project, CLion opens this project. If you open a directory that is not a part of a project, CLion adds the  `.idea`  directory to it, making it a project.

