Ir al contenido
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Inicia sesión
  • Nederlands English (US) Español (AR)
  • Contáctanos
  • Inicio
  • Blog
  • Empleos
  • Contáctanos
Cafayate.Net
  • 0
  • 0
    • Inicio
    • Blog
    • Empleos
    • Contáctanos
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Inicia sesión
  • Contáctanos

How can I recursively delete all files of a specific extension in the current directory?

  • Todos los blogs
  • Tech Blog
  • How can I recursively delete all files of a specific extension in the current directory?
  • 5 de marzo de 2021 por
    Administrator

    You don’t even need to use rm in this case if you are afraid. Use find:

    find . -name "*.bak" -type f -delete
    

    But use it with precaution. Run first:

    find . -name "*.bak" -type f
    

    to see exactly which files you will remove.

    Also, make sure that -delete is the last argument in your command. If you put it before the -name *.bak argument, it will delete everything.

    See man find and man rm for more info and see also this related question on SE:

    • How do I remove all .pyc files from a project?
    en Tech Blog
    Odoo install 8.0 / 9.0 / 10.0

    Diseñado para empresas

    Somos un equipo de personas apasionadas cuyo objetivo es mejorar la vida de todos a través de productos revolucionarios. Creamos grandes productos para resolver sus problemas empresariales. Nuestros productos están diseñados para pequeñas y medianas empresas dispuestas a optimizar su rendimiento.

    Contáctenos

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

    • +31 653-919-302
    • [email protected]
    Síganos
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)