How to Check if Unrar Is in System PATH

Configuring the unrar utility in your system's PATH environment variable allows you to extract RAR archives directly from any directory using the command line. This guide provides a straightforward method to verify whether unrar is properly configured on Windows, macOS, and Linux systems, explains the commands used to locate the executable, and highlights how to identify PATH-related errors.

The Quick Test: Run the Unrar Command

The fastest way to verify if unrar is recognized globally is to call it directly from your command-line interface.

  1. Open Command Prompt or PowerShell (on Windows) or Terminal (on macOS and Linux).

  2. Type the following command and press Enter:

    unrar

Interpreting the Output:

  • Properly Configured: The terminal outputs a list of version details, commands, and switches (e.g., UNRAR 6.x.x freeware...).
  • Not Configured: The system returns an error message:
    • On Windows: 'unrar' is not recognized as an internal or external command, operable program or batch file.
    • On Linux/macOS: command not found: unrar or unrar: command not found.

Verifying the Executable Path

If you want to confirm the exact location where your operating system finds the unrar binary, use the platform-specific lookup commands.

On Windows

Open Command Prompt and run:

where unrar
  • Success: It displays the full file path to the executable, such as C:\Program Files\WinRAR\unrar.exe.
  • Failure: It returns INFO: Could not find files for the given pattern(s).

On Linux and macOS

Open Terminal and run:

which unrar

(Alternatively, use command -v unrar or type -a unrar)

  • Success: It displays the installation path, such as /usr/bin/unrar or /usr/local/bin/unrar.
  • Failure: It produces no output or displays a "not found" message.

Inspecting the PATH Variable Directly

If the utility is installed but cannot be called, verify that the directory containing unrar is present inside your environment variables.

  • Windows:
    echo %PATH%
    Look for the directory path containing unrar.exe (e.g., C:\Program Files\WinRAR).
  • Linux/macOS:
    echo $PATH
    Ensure common binary directories like /usr/bin, /usr/local/bin, or your custom installation folder are listed.

What to Do if It Is Not Configured

If the tests fail despite unrar being installed:

  1. Locate the directory containing the unrar executable on your hard drive.
  2. Add that folder path to your system's PATH environment variable:
    • Windows: Search for "Edit the system environment variables" in the Start menu, click Environment Variables, select Path under User or System variables, click Edit, and add the folder.
    • Linux/macOS: Add export PATH="$PATH:/path/to/unrar" to your shell profile (~/.bashrc, ~/.zshrc).
  3. Restart your command line interface and run the test commands again.