Quick way to list all files in Amazon S3 bucket?

前端 未结 28 1862
星月不相逢
星月不相逢 2020-11-28 01:32

I have an amazon s3 bucket that has tens of thousands of filenames in it. What\'s the easiest way to get a text file that lists all the filenames in the bucket?

28条回答
  •  不知归路
    2020-11-28 01:39

    You can list all the files, in the aws s3 bucket using the command

    aws s3 ls path/to/file
    

    and to save it in a file, use

    aws s3 ls path/to/file >> save_result.txt
    

    if you want to append your result in a file otherwise:

    aws s3 ls path/to/file > save_result.txt
    

    if you want to clear what was written before.

    It will work both in windows and Linux.

提交回复
热议问题