If you get the error message "bash: aws: command not found," it means that the aws
command is not installed on your system or it is not in your current PATH
environment variable. To fix this, you will need to install the AWS Command Line Interface (CLI) on your system and then configure your PATH
environment variable to include the directory where the aws
executable is located.
To install the AWS CLI, you will first need to download the appropriate installer for your operating system from the AWS website. Once you have downloaded the installer, you can run it to install the AWS CLI on your system.
Once the AWS CLI is installed, you will need to update your PATH
environment variable to include the directory where the aws
executable is located. The exact steps for doing this will vary depending on your operating system. Still, you can typically do this by editing the .bash_profile
or .bashrc
file in your home directory and adding a line that sets the PATH
variable to include the directory where the aws
executable is located. For example, if the AWS CLI is installed in /usr/local/aws
, you would add the following line to your .bash_profile
or .bashrc
file:
export PATH=$PATH:/usr/local/aws
After updating your PATH
environment variable, you will need to open a new terminal window or run the source
command to reload your .bash_profile
or .bashrc
file and apply the changes. Once you have done this, you should be able to run the aws
command from the command line.
If you continue to have issues with the aws
command not being found, you may need to consult the AWS documentation or seek help from the AWS support team.
How to install AWS CLI
To install the AWS CLI on macOS, Linux, or Windows, you can use the following instructions:
Open a web browser and navigate to the AWS CLI download page: https://aws.amazon.com/cli/
Scroll down to the "Installing the AWS CLI" section and click on the appropriate link for your operating system to download the installer:
For macOS, click on the "macOS" link to download the
.pkg
installer file.For Linux, click on the "Linux" link to download the
.zip
or.tar.gz
file.For Windows, click on the "Windows" link to download the
.msi
installer file.
Once the installer file has been downloaded, open it and follow the on-screen instructions to install the AWS CLI on your system.
After the AWS CLI has been installed, you can verify that it is working correctly by running the
aws --version
command. This should print the version number of the AWS CLI that you have installed.If you are using Linux or macOS, you may also need to update your
PATH
environment variable to include the directory where theaws
executable is located. To do this, you can edit the.bash_profile
or.bashrc
file in your home directory and add a line that sets thePATH
variable to include the directory where the AWS CLI is installed. For example, if the AWS CLI is installed in/usr/local/aws
, you would add the following line to your.bash_profile
or.bashrc
file:
export PATH=$PATH:/usr/local/aws
After updating your
PATH
environment variable, you will need to open a new terminal window or run thesource
command to reload your.bash_profile
or.bashrc
file and apply the changes. Once you have done this, you should be able to run theaws
command from the command line.
For more detailed instructions and additional information, you can refer to the AWS CLI installation guide: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html