Fix: zsh: command not found: aws (Mac/macOS)


Mac Terminal Error:
% aws s3 ls
zsh: command not found: aws


  1. The most common reason for the error is that you do not have aws command line tool not installed on your Mac device.

    How to install "aws command line (awscli)" tool on the Mac?

    Option 1: Using Homebrew Package Manager

    As brew is the most popular package manager for macOS, you can try installing awscli using the brew install command.

    • Open Terminal Application.
    • Make sure brew is installed (if now follow this article: link
    • Now run the command: brew install awscli
    • This will fix the aws command not found error!

    Option 2: Using GUI Installer

    If you are a GUI person, well there is an option for that as well.

    • Download the AWSCLIv2 pkg file: https://awscli.amazonaws.com/AWSCLIV2.pkg
    • Just follow the instructions after clicking the software file - you will be asked to agree on license and your Mac password for installation.
    • 1 - Install AWS Command Line Interface Welcome to the AWS Command Line Interface Installer Screen
      2 - Install AWS CLI Important Information Screen
      3 - AWS CLI Installation Software License Agreement Screen
      4 - AWS CLI Installation location local on Mac
      5 - AWS CLI Standard Installation Screen
      6 - AWS CLI installation was successful Screen

    Option 3: Using Command Line Curl Command

    If you are a GUI person, well there is an option for that as well.

    • Download the pkg file using curl command on your Terminal.
      % curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
    • Now install the package using installer command,
      % sudo installer -pkg AWSCLIV2.pkg -target /


  2. The other reason for the error could be that AWS CLI is not added in the PATH environment variable. Make sure to add it to the path of .zshrc file that you can find under home

    Open this file ~/.zshrc using VIM or Nano editor and check.

    % nano ~/.zshrc

  3. You can know where aws cli has been installed using the command which.

    Example:
    % which aws
    /opt/homebrew/bin/aws

    Facing issues? Have Questions? Post them here! I am happy to answer!

    Author Info:

    Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

    Follow him on: X

    You can also reach out to him via e-mail: rakesh@code2care.org

Copyright ยฉ Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap