Overslaan naar inhoud
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Aanmelden
  • Nederlands English (US) Español (AR)
  • Contact
  • Startpagina
  • Blog
  • Vacatures
  • Contact
Cafayate.Net
  • 0
  • 0
    • Startpagina
    • Blog
    • Vacatures
    • Contact
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Aanmelden
  • Contact

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

  • Alle blogs
  • Tech Blog
  • How can I recursively delete all files of a specific extension in the current directory?
  • 5 maart 2021 in
    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?
    in Tech Blog
    Odoo install 8.0 / 9.0 / 10.0

    Ontworpen voor bedrijven

    We zijn een team van gepassioneerde mensen met als doel levens te verbeteren met vernieuwende producten. We ontwikkelen geweldige oplossingen voor al je zakelijke uitdagingen. Onze producten zijn ontworpen voor kleine tot middelgrote bedrijven die hun prestaties willen optimaliseren.

    Neem contact op

    Plantexel
    Pedernera
    Salta Capital 
    Argentina

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