如何使用AWS递归地列出桶的所有内容,类似于在Unix上使用find .
。
aws s3 ls s3://MyBucket --recursive
以未知的选项抱怨。
http://docs.aws.amazon.com/cli/latest/reference/s3/index.html#directory-and-s3-prefix-operations声称--recursive
是一个有效的参数。
发布于 2014-11-19 22:36:37
aws s3 ls s3://MyBucket --recursive
对我来说很好。
尝试更新AWS CLI。我的版本是aws/1.6.2
aws --version
发布于 2021-08-23 14:32:56
对于最近的AWS 版本,支持--recursive
选项。
可以使用以下命令递归列出名为MyBucket的桶下的所有文件:
aws s3 ls s3://MyBucket/ --recursive
可以使用以下命令递归列出桶中名为MyFolder的文件夹下的所有文件:
aws s3 ls s3://MyBucket/MyFolder/ --recursive
正如@Francisco所说,最终的/
是非常重要的。它允许列出文件夹的内容,而不是文件夹本身。
有关更多信息,请参见:https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html
发布于 2013-12-20 04:23:25
我无法正确解释您所引用的链接:http://docs.aws.amazon.com/cli/latest/reference/s3/index.html#directory-and-s3-prefix-operations
然而,我能够使--recursive
选项与这个链接:http://docs.aws.amazon.com/cli/latest/reference/s3/index.html#single-local-file-and-s3-object-operations一起工作。
根据这个链接,cp
、mv
和rm
支持--recursive
选项。
您正在尝试的是ls
。
我尝试使用cp
和rm
以及--recursive
选项,它运行得很好。
https://stackoverflow.com/questions/20662917
复制相似问题