I downloaded the AWS CloudWatch command line api and I have also set the env_path variable that is AWS_CLOUDWATCH_HOME=local/usr/CloudWatch. But when I run mon-cmd, I get command not found error in the console. I am working on ubuntu 10.04 server which is a EC2 instance.

It's been to couple of days I am struck with this problem, in spite of setting the path variables correctly I am facing this problem.

Kindly help me out

  • Can you find this command mod-cmd in your system somewhere? Use locate or find to check. – Khaled Jan 7 '12 at 10:30

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):


Or permanently, by modifying (or appending) the PATH in your users' .bash_profile:

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:


Find the file with find / -type f -name mon-cmd 2>/dev/null then add the folder where the file is located to $PATH by running: export PATH=$PATH:/path/to_mon-cmd/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.