How to Delete Millions of Files from a Folder

image
Volodymyr Hodiak
May 1, 2019|3 min read|1167 views

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 ;)

Share

CONTACT US

By submitting this form I consent to processing my personal data as described in thePRIVACY POLICY

We are open to answer you directly

image
image

Serhiy Lavrynenko

Volodymyr Hodiak

CEO

CTO