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

146
Vistas
Why is find -delete faster than rm -rf?

Why is find ... -delete so much faster than rm -rf ? Specifically,

To clarify: I'm specifically asking: Why is find ./x -type d -delete && rm -rf x so much faster than rm -rf x/?

Background

There have been a few people who use similar mechanisms, like rsync.

  • There are several posts on why rm -rf is slow. For example, https://unix.stackexchange.com/questions/106133/why-is-rm-slow is probably one of the most focused ones.

  • Specifically, I've found cd dir-to-delete && find . -type d -delete followed by rm -rf dir-to-delete is extremely fast, even on large directories.

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

0

rm -f isn't slow, but if you run it many files and you fire up a separate process per each rm, then it will be slow, because starting a process will cost you about 2ms on modern processor, and many files can be deleted in that time if you instead delete in batches, which is what find's -delete does. Alternatively, you can use xargs to run rm with a batch to pretty much the same effect.

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