Back

How to Delete Millions of Files from a Folder

Volodymyr Hodiak
Volodymyr Hodiak
May 1, 2019 3 min read 1019 views
May 1, 2019 3 min read 1019 views
image

Have you ever tried to delete millions of files from one folder? Quite often this question is discussed on forums. 
It’s true that a common method rm -rf fails if there are too many files. A simple solution looks the following way.

Search for files by mask and the files with these names will be deleted.

# find /path/to/files/ -type f | xargs rm

Now you can have tea and cookies ;)

POSTED IN:

How about to rate this article?

  • 1
  • 2
  • 3
  • 4
  • 5

RELATED ARTICLES

Explore all articles Explore all articles

let`s get in touch!

    By submitting this form I consent to processing my personal data as described in the Privacy Policy

    Success!
    Thanks for your message.

    While we are processing your request, don’t hesitate and follow us on social networks!

    Michael Askew

    CEO, ASKWHO

    Simon Nilsson

    Co-CEO, Work-Wide Group

    Dr. Arne-Rasmus Draeger

    Executive, ACARiS

    Samuel Bleakly

    Marketing Director, Coto World

    Philip Ly

    CEO, LES Automotive

    Vance Heron

    CTO, PeteHealth

    Tobias Sturesson

    CEO, Fervent

    Alex Reizer

    Product Manager, Kadabra

    Shlomie Singer

    Co-Founder & Owner at uBranded

    Artyom Popov

    Co-Founder at Escape Room

    Michal Nowakowski

    Founder in a Castles.today

    Alex Ostroverkh

    CEO at PettersonApps

    Mariya Osnovina

    Brand Manager – Intersono IVF clinic

    Waleed Kharma

    Managing Director, Foxtrapp

    Pavlo Lysy

    CEO & Founder, Panem