# Compare files from the command line

Open the [diff viewer](differences-viewer.html)   to compare two or three files from the command line. For example, you can compare the current version of a file with its backup, or your local copy of a file with its copy from the remote repository or its copy from another branch.

Windows:

You can find the executable for running IntelliJ IDEA in the [installation directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html) under `bin`. To use this executable as the command-line launcher, add it to your system `PATH` as described in [Command-line interface](working-with-the-ide-features-from-command-line.html).

Syntax
: ```PLAINTEXT
: idea64.exe diff <path1> <path2> [<path3>]
: ```

Examples
: Compare two files:
:
:
:
:
: ```SHELL
: idea64.exe diff C:\MyProject\Readme.md C:\MyProject\Readme.md.bak
: ```
:
:
:
: Open a blank diff viewer:
:
:
:
:
: ```SHELL
: idea64.exe diff
: ```

macOS:

By default, IntelliJ IDEA does not provide a command-line launcher. For more information about creating a launcher script for IntelliJ IDEA, refer to [Command-line interface](working-with-the-ide-features-from-command-line.html).

Syntax
: ```PLAINTEXT
: idea diff <path1> <path2> [<path3>]
: ```

Examples
: Compare two files:
:
:
:
:
: ```SHELL
: idea diff ~/MyProject/Readme.md ~/MyProject/Readme.md.bak
: ```
:
:
:
: Open a blank diff viewer:
:
:
:
:
: ```SHELL
: idea diff
: ```

Linux:

You can find the script for running IntelliJ IDEA in the [installation directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html) under `bin`. To use this script as the command-line launcher, add it to your system `PATH` as described in [Command-line interface](working-with-the-ide-features-from-command-line.html).

Syntax
: ```PLAINTEXT
: idea.sh diff <path1> <path2> [<path3>]
: ```

Examples
: Compare two files:
:
:
:
:
: ```SHELL
: idea.sh diff ~/MyProject/Readme.md ~/MyProject/Readme.md.bak
: ```
:
:
:
: Open a blank diff viewer:
:
:
:
:
: ```SHELL
: idea.sh diff
: ```

