How can I resolve the zsh command not found aws error when trying to run AWS CLI commands in my terminal

0 votes

I'm having trouble using AWS CLI commands in my terminal because I keep seeing the error "zsh: command not found: aws." I think it might be a problem with the installation or the PATH. Can you help me fix this?

Oct 16 in AWS by Priyanka
• 2,940 points
120 views

1 answer to this question.

0 votes

To resolve the 'zsh: command not found: aws' error when trying to run AWS CLI commands - 

  1. First, check if AWS CLI is installed: First, check if AWS CLI is already installed by typing:
    aws --version

  2. If you still see the 'command not found' error, it means AWS CLI is either not installed or not set up properly.

  3. Install AWS CLI: If it's not installed, you can install it with these commands: For Mac:
    curl "https://awscli.amazonaws.com/AWSCLIV2.pg" -o "AWSCLIV2.pkg"

sudo installer -pkg AWSCLIV2.pkg -target /

For Linux:
sudo apt install awscli

  1. You can also follow the official AWS installation guide for your operating system.

  2. Check if AWS CLI is in your system path: Even if AWS CLI is installed, it may not be added to your $PATH. To check, run:
    echo $PATH

  3. This will show the directories where your system looks for installed programs. If AWS CLI’s location isn’t listed, you'll need to add it manually.

  4. Add AWS CLI to your path:To add AWS CLI to your $PATH, you need to edit your .zshrc file by running:
    nano ~/.zshrc

  5. Add the following line, replacing /path/to/aws-cli with the actual path where AWS CLI is installed:
    export PATH=$PATH:/path/to/aws-cli

  6. After saving, run:
    source ~/.zshrc

  7. This will reload your configuration and add AWS CLI to your path.

  8. Verify the installation: Once you’ve completed the above steps, verify everything is working correctly by typing:
    aws --version

  9. This should now show the AWS CLI version, confirming it’s installed properly.

  10. Restart your terminal: If you still encounter issues, try restarting your terminal to ensure all changes take effect.

If you need more help or want to learn AWS in detail, check out the this blog and courses for the best resources and certifications on AWS!

answered Oct 17 by anonymous

edited Oct 29 by Priyanka

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

how to get the list of aws services i am used in aws my account by using the lambda function

Hi@shalk, You can create a session in your ...READ MORE

answered Sep 24, 2020 in AWS by MD
• 95,460 points
2,450 views
0 votes
1 answer
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
5,946 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,200 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How can I obtain my AWS Access Key ID for accessing AWS services?

 A step-by-step guide to help you easily obtain ...READ MORE

answered Oct 17 in AWS by Chetuzz

edited Oct 18 by Hoor 111 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP