Answer the question
In order to leave comments, you need to log in
BASH: how to delete a huge number of directories containing directories and files?
Actually, subject.
There is an abstract /data/maindir containing many subdirectories containing several more levels of subdirectories and small files at the lowest level.
How to clean up /data/maindir as quickly as possible (you don't need to delete this directory)?
Answer the question
In order to leave comments, you need to log in
It will not work quickly, alas ...
There are several options, the very first is to rename this directory and create a new one in its place with the same name and rights.
And already leisurely clean the renamed directory.
It is best, of course, to mount the partition at this point, and format it if necessary.
find /pathto [ options ] -delete
deletes what is set and the fastest,
and without the -delete key, you can check that the list is the one you wanted.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question