I have a aws s3 bucket s3://bucket1/ that has multiple subdirectories at two levels with the structure s3://bucket1/shard-*/task-*/filename1.txt and I have to select random 100 files from the bucket. What I did was to use "aws s3 ls recursive" along with awk and shuf to get a list of these 100 files and store it in a file. But now I wanted to copy these 100 files into a specific bucket in s3. How do I go about doing this? Is there a "aws s3 cp" where I can use the list?
s3://bucket1/
s3://bucket1/shard-*/task-*/filename1.txt
"aws s3 ls recursive"
2.1m questions
2.1m answers
60 comments
57.0k users