Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws s3 ls Unknown options: --recursive

I am trying to list the contents of an Amazon S3 bucket using the following command (documentation):

aws s3 ls s3://mybucket --recursive

However, I get the following error:

Unknown options: --recursive

The following is the version information for my Ubuntu Linux EC2 instance:

$aws s3 ls --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-85-generic

How can I enable the --recursive option on my aws-cli?

like image 558
Borealis Avatar asked Feb 25 '26 05:02

Borealis


2 Answers

'aws s3 ls --recursive' was added in version 1.2.11 - you are using version 1.2.9 - an outdated version. Please upgrade to the latest version.

pip install -U awscli
like image 99
Shimon Tolts Avatar answered Feb 27 '26 19:02

Shimon Tolts


If you have installed aws-cli using command apt-get install awscli on ubuntu, it installs the older version of aws cli.

You can install the latest aws-cli using pip command, make sure pip is installed on your system. Install aws-cli using this command

pip install -U awscli

To install pip you can use follow commands

sudo apt-get install python-pip
sudo apt-get install python3-pip -> On python3
like image 31
skipper21 Avatar answered Feb 27 '26 18:02

skipper21



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!