So I had my aws cli 1 installed and I installed awscli 2.[latest version] and found out that the command aws belongs to 1.0 . ie aws –version return the version of 1 and to use aws 2 I need to use
$ /usr/local/bin/aws --version aws-cli/2.1.38 Python/3.8.8 Linux/5.8.0-48-generic exe/x86_64.ubuntu.20 prompt/off
Which is ridiculous. I was using this guide to install awscli 2.
So now I removed awscli version 1 and removed awscli 2, reinstalled version two but I was still not getting the keyword aws. when I typed aws –version I was getting this error.
$ aws --version bash: ~/.local/bin/aws: No such file or directory
the following two line helped me determine where my installation were
$ which aws /usr/local/bin/aws $ ls -l /usr/local/bin/aws lrwxrwxrwx 1 root root 37 April 20 01:36 /usr/local/bin/aws -> /usr/local/aws-cli/v2/current/bin/aws
then all I had to do is add that path to $PATH which I was able to do after trying other stuff.
now it works!
$ aws --version aws-cli/2.1.38 Python/3.8.8 Linux/5.8.0-48-generic exe/x86_64.ubuntu.20 prompt/off