Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

198
Vistas
How to remove multiple S3 buckets at once?

I have a dozen of buckets that I would like to remove in AWS S3, all having a similar name containing bucket-to-remove and with some objects in it.

Using the UI is quite slow, is there a solution to remove all these buckets quickly using the CLI?

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

You could try this sample line to delete all at once. Remember that this is highly destructive, so I hope you know what you are doing:

for bucket in $(aws s3 ls | awk '{print $3}' | grep my-bucket-pattern); do  aws s3 rb "s3://${bucket}" --force ; done

You are done with that. May take a while depending on the amount of buckets and their content.

over 4 years ago · Santiago Trujillo Denunciar

0

I did this

aws s3api list-buckets \
   --query 'Buckets[?starts_with(Name, `bucket-pattern `) == `true`].[Name]' \
   --output text | xargs -I {} aws s3 rb s3://{} --force

Then update the bucket pattern as needed.

Be careful though, this is a pretty dangerous operation.

over 4 years ago · Santiago Trujillo Denunciar

0

The absolute easiest way to bulk delete S3 buckets is to not write any code at all. I use Cyberduck to browse my S3 account and delete buckets and their contents quite easily.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda