aws s3 ls recursive grep extension '.mov' and total size

joj*_*ojo 2 amazon-s3 amazon-ec2 amazon-web-services aws-cli

I would like to know how to list the files in amazon s3 bucket by recursive way and filter .mov files.

Sample output:

sample:

filename1.mov1    120mb<br>
filename2.mov2    300mb

Total Object : 2
Total Size: 420mb
Run Code Online (Sandbox Code Playgroud)

my current command below:

aws s3 ls --summarize --human-readable --recursive s3://mybucket/Videos
Run Code Online (Sandbox Code Playgroud)

Thanks

hel*_*loV 6

--include并且--exclude选项不适用于aws s3 ls

一种选择是 grep for*.mov*但您将丢失总对象和大小信息。

aws s3 ls --summarize --human-readable --recursive s3://mybucket/Videos | egrep '*.mov*'
Run Code Online (Sandbox Code Playgroud)