Remove many many many files from a folder
As I can see you don't need to remove your dir , only files inside. So you can recreate it
rm -r /path/to/dir && mkdir /path/to/dir
or even delete only files inside
find /path/to/dir -type f -delete
afair first one works faster.
UPD. Note that way with find
might be not optimal from space consumption point of view, as directory size will be reduced only after fsck
. Details.
Workaround #1:
find /path/to/dir -delete
Workaround #2:
rm a*;
rm b*;
rm c*;
etc