Command not found usually means exactly that - that the operating system can't locate the command you are trying to execute. The operating system only looks in a select few folders for the application. This list of folders is defined by the PATH variable.
You can view your current PATH variable with:
echo $PATH
One possible output of this is:
/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin:/root/bin
You will note, in the above output that I have my AWS API tools in /opt/aws/bin
. Edit your PATH variable to include the location of the mon-cmd
program. You can do so, either:
Temporarily (from bash prompt):
PATH=$PATH:/path/to/api-tools
Or permanently, by modifying (or appending) the PATH in your users' .bash_profile
:
PATH=$PATH:/path/to/api-tools
export $PATH
Be careful! Ensure you do not leave out the $PATH - this includes the existing PATH and only adds the new one - otherwise you will overwrite your existing PATH and no programs will work if they are not run with an absolute path.
You can verify that you have done so successfully by running (which should return the correct location)
whereis mon-cmd
(Sample output: mon-cmd: /path/to/api-tools/mon-cmd
)
Alternatively, you can run the command directly from wherever it is located:
/path/to/api-tools/mod-cmd`
mod-cmd
in your system somewhere? Uselocate
orfind
to check.