If you have installed a new binary on a Linux or BSD system and the shell does not recognize the binary, it is likely that the binary is not in a directory that is included in the PATH
environment variable.
The PATH
environment variable is a list of directories that the shell searches when you enter a command. If the binary is not in one of the directories listed in PATH
, the shell will not be able to find it.
To fix this issue, you can either move the binary to a directory that is included in PATH
, or you can add the directory where the binary is located to PATH
.
To add a directory to PATH
, you can edit the .bashrc
or .bash_profile
file in your home directory and add the following line:
export PATH=$PATH:/path/to/binary
Replace /path/to/binary
with the directory where the binary is located.
After making the above change, you will need to either log out and log back in, or run the following command to apply the changes:
source ~/.bashrc
This will update the PATH
environment variable and allow the shell to recognize the newly installed binary.