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.
Open Command Prompt or PowerShell (on Windows) or Terminal (on macOS and Linux).
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: unrarorunrar: command not found.
- On Windows:
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/unraror/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:
Look for the directory path containing
echo %PATH%unrar.exe(e.g.,C:\Program Files\WinRAR). - Linux/macOS:
Ensure common binary directories like
echo $PATH/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:
- Locate the directory containing the
unrarexecutable on your hard drive. - Add that folder path to your system's
PATHenvironment variable:- Windows: Search for "Edit the system environment
variables" in the Start menu, click Environment
Variables, select
Pathunder 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).
- Windows: Search for "Edit the system environment
variables" in the Start menu, click Environment
Variables, select
- Restart your command line interface and run the test commands again.